summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-06-09 12:55:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:21 -0500
commitd28456fe2250dd5a6d28d38ffd0aee9197c1b4ba (patch)
treecdda7114300cf987ad2dc3af666cd00b93727250 /source3
parent97f496a0e3e19a8d35f209d6896c2ebc4ccfb9db (diff)
downloadsamba-d28456fe2250dd5a6d28d38ffd0aee9197c1b4ba.tar.gz
samba-d28456fe2250dd5a6d28d38ffd0aee9197c1b4ba.tar.bz2
samba-d28456fe2250dd5a6d28d38ffd0aee9197c1b4ba.zip
r16121: Fix a eDir related memory leak.
Guenther (This used to be commit 322f1664df553d95fcdfc24f19bd7f34ce9b834b)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_ldap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index fbc6378f68..79c1eda459 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -730,14 +730,21 @@ static BOOL init_sam_from_ldap(struct ldapsam_privates *ldap_state,
pwd_len = sizeof(clear_text_pw);
if (pdb_nds_get_password(ldap_state->smbldap_state, user_dn, &pwd_len, clear_text_pw) == LDAP_SUCCESS) {
nt_lm_owf_gen(clear_text_pw, smbntpwd, smblmpwd);
- if (!pdb_set_lanman_passwd(sampass, smblmpwd, PDB_SET))
+ if (!pdb_set_lanman_passwd(sampass, smblmpwd, PDB_SET)) {
+ SAFE_FREE(user_dn);
return False;
+ }
ZERO_STRUCT(smblmpwd);
- if (!pdb_set_nt_passwd(sampass, smbntpwd, PDB_SET))
+ if (!pdb_set_nt_passwd(sampass, smbntpwd, PDB_SET)) {
+ SAFE_FREE(user_dn);
return False;
+ }
ZERO_STRUCT(smbntpwd);
use_samba_attrs = False;
}
+
+ SAFE_FREE(user_dn);
+
} else {
DEBUG(0, ("init_sam_from_ldap: failed to get user_dn for '%s'\n", username));
}