diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-03-21 04:00:25 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-03-21 04:00:25 +0000 |
commit | 0f08930b3257dfb6b6c059b7aaa6ba7fa5b4f7be (patch) | |
tree | 8def1bef0cde7a895f1a9655158946eb499cb2d0 /source3 | |
parent | 93d25c293ff1a763f275e1769cabf68058f09a4e (diff) | |
download | samba-0f08930b3257dfb6b6c059b7aaa6ba7fa5b4f7be.tar.gz samba-0f08930b3257dfb6b6c059b7aaa6ba7fa5b4f7be.tar.bz2 samba-0f08930b3257dfb6b6c059b7aaa6ba7fa5b4f7be.zip |
Don't leak memory on failure.
(This used to be commit 438f028fc45ee6c5b12fa960beabea4b5fdcff38)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/passdb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 2f19698ffa..9b1bd3d211 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -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); |