s3-auth: Steal the memory to avoid duplication.
authorAndreas Schneider <asn@samba.org>
Fri, 28 Feb 2014 16:16:27 +0000 (17:16 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 13 Mar 2014 14:08:26 +0000 (15:08 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/auth/server_info_sam.c

index 6cd791e009088d72b5969c68dab213e2bb3cae4a..fef60c2fbd6482bff4b5524f805e444b494a29ea 100644 (file)
@@ -96,11 +96,7 @@ NTSTATUS make_server_info_sam(TALLOC_CTX *mem_ctx,
                goto out;
        }
 
-       server_info->unix_name = talloc_strdup(server_info, pwd->pw_name);
-       if (server_info->unix_name == NULL) {
-               status = NT_STATUS_NO_MEMORY;
-               goto out;
-       }
+       server_info->unix_name = talloc_steal(server_info, pwd->pw_name);
 
        server_info->utok.gid = pwd->pw_gid;
        server_info->utok.uid = pwd->pw_uid;