1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00

Don't leak memory on failure.

This commit is contained in:
Andrew Bartlett 0001-01-01 00:00:00 +00:00
parent 56009ffbaa
commit 438f028fc4

View File

@ -757,8 +757,10 @@ DOM_SID *local_uid_to_sid(DOM_SID *psid, uid_t uid)
if(!(pass = getpwuid_alloc(uid)))
return NULL;
if (NT_STATUS_IS_ERR(pdb_init_sam(&sam_user)))
if (NT_STATUS_IS_ERR(pdb_init_sam(&sam_user))) {
passwd_free(&pass);
return NULL;
}
if (!pdb_getsampwnam(sam_user, pass->pw_name)) {
pdb_free_sam(&sam_user);