From ed9c0907370e9582328a6e6cb6619f2897225cb6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 7 Jun 2003 03:22:37 +0000 Subject: Try to fix memory leaks found by valgrind in pdb_ldap code. Andrew Bartlett (This used to be commit decadfcc8205ed5611d74141e301569ef8b1d9f4) --- source3/passdb/pdb_ldap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/passdb') 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; } -- cgit