Fix double free caused by incorrect talloc_steal usage.
authorDan Sledz <dsledz@isilon.com>
Thu, 12 Feb 2009 20:02:43 +0000 (12:02 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 12 Feb 2009 20:02:43 +0000 (12:02 -0800)
source/auth/auth_util.c

index d2a8591ae61e9e97dadc3877dd86b21997f0edad..9ee19ca798fc26eef0b294a9b7036227ed4d2ec5 100644 (file)
@@ -573,8 +573,6 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
        }
 
        result->sam_account = sampass;
-       /* Ensure thaat the sampass will be freed with the result */
-       talloc_steal(result, sampass);
        result->unix_name = pwd->pw_name;
        /* Ensure that we keep pwd->pw_name, because we will free pwd below */
        talloc_steal(result, pwd->pw_name);
@@ -665,6 +663,8 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info,
                 pdb_get_username(sampass), result->unix_name));
 
        *server_info = result;
+       /* Ensure thaat the sampass will be freed with the result */
+       talloc_steal(result, sampass);
 
        return NT_STATUS_OK;
 }