summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-06-07 03:22:37 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-06-07 03:22:37 +0000
commited9c0907370e9582328a6e6cb6619f2897225cb6 (patch)
tree6e58fba0e7b6bbd2e386239422dc2a0ab6049946
parent1079bd40c50b75324464ea059141656b23ccf31a (diff)
downloadsamba-ed9c0907370e9582328a6e6cb6619f2897225cb6.tar.gz
samba-ed9c0907370e9582328a6e6cb6619f2897225cb6.tar.bz2
samba-ed9c0907370e9582328a6e6cb6619f2897225cb6.zip
Try to fix memory leaks found by valgrind in pdb_ldap code.
Andrew Bartlett (This used to be commit decadfcc8205ed5611d74141e301569ef8b1d9f4)
-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;
}