summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index c79564ac6f..e484818c5d 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -2288,6 +2288,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
DEBUG(4,
("Unable to locate SID [%s] count=%d\n", sid_to_string(sid_string, sid),
count));
+ ldap_msgfree(result);
return NT_STATUS_NO_SUCH_USER;
}
else if (count > 1)
@@ -2295,6 +2296,7 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
DEBUG(1,
("More than one user with SID [%s]. Failing. count=%d\n", sid_to_string(sid_string, sid),
count));
+ ldap_msgfree(result);
return NT_STATUS_NO_SUCH_USER;
}
@@ -2306,11 +2308,9 @@ static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
ldap_msgfree(result);
return NT_STATUS_NO_SUCH_USER;
}
- ldap_msgfree(result);
ret = NT_STATUS_OK;
- } else {
- ldap_msgfree(result);
}
+ ldap_msgfree(result);
return ret;
}