summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/passdb/passdb.c4
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);