r26413: we should check the return value of talloc_reference()
authorStefan Metzmacher <metze@samba.org>
Wed, 12 Dec 2007 09:13:08 +0000 (10:13 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:49:45 +0000 (05:49 +0100)
metze
(This used to be commit 5f49c1b144d811c4d8bd74d786e5c5ef6fa7cbc3)

source4/auth/auth_util.c

index baecb15f1e3d59c935f9628eecf7552853b9ad3a..b1f0e60507dab5a88b00278b0ac0ddcceae80323 100644 (file)
@@ -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;