mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
Fix double free caused by incorrect talloc_steal usage.
This commit is contained in:
parent
989944f8e9
commit
4e69f23857
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user