1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-15 05:57:49 +03:00

Don't leak memory on failure.

(This used to be commit 438f028fc45ee6c5b12fa960beabea4b5fdcff38)
This commit is contained in:
Andrew Bartlett 2002-03-21 04:00:25 +00:00
parent 93d25c293f
commit 0f08930b32

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);