From 4e69f23857289bd58f4adad85602c8afc3bed03a Mon Sep 17 00:00:00 2001 From: Dan Sledz Date: Sun, 8 Feb 2009 11:40:26 -0800 Subject: Fix double free caused by incorrect talloc_steal usage. --- source3/auth/auth_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index e3677c41a4..502d06fad3 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -573,8 +573,6 @@ NTSTATUS make_server_info_sam(auth_serversupplied_info **server_info, } result->sam_account = sampass; - /* Ensure that 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 that the sampass will be freed with the result */ + talloc_steal(result, sampass); return NT_STATUS_OK; } -- cgit