From 5bddcf45f30e1a30511141e86232c7378073f629 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 12 Dec 2007 10:13:08 +0100 Subject: r26413: we should check the return value of talloc_reference() metze (This used to be commit 5f49c1b144d811c4d8bd74d786e5c5ef6fa7cbc3) --- source4/auth/auth_util.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source4/auth') diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c index baecb15f1e..b1f0e60507 100644 --- a/source4/auth/auth_util.c +++ b/source4/auth/auth_util.c @@ -81,7 +81,9 @@ NTSTATUS map_user_info(TALLOC_CTX *mem_ctx, if (!*user_info_mapped) { return NT_STATUS_NO_MEMORY; } - talloc_reference(*user_info_mapped, user_info); + if (!talloc_reference(*user_info_mapped, user_info)) { + return NT_STATUS_NO_MEMORY; + } **user_info_mapped = *user_info; (*user_info_mapped)->mapped_state = true; (*user_info_mapped)->mapped.domain_name = talloc_strdup(*user_info_mapped, domain); @@ -129,7 +131,9 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex if (!user_info_temp) { return NT_STATUS_NO_MEMORY; } - talloc_reference(user_info_temp, user_info_in); + if (!talloc_reference(user_info_temp, user_info_in)) { + return NT_STATUS_NO_MEMORY; + } *user_info_temp = *user_info_in; user_info_temp->mapped_state = to_state; @@ -193,7 +197,9 @@ NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_contex if (!user_info_temp) { return NT_STATUS_NO_MEMORY; } - talloc_reference(user_info_temp, user_info_in); + if (!talloc_reference(user_info_temp, user_info_in)) { + return NT_STATUS_NO_MEMORY; + } *user_info_temp = *user_info_in; user_info_temp->mapped_state = to_state; -- cgit