diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-07-18 09:05:30 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-07-18 09:05:30 +0000 |
commit | ffbb6ee3b8ee815e5e4f8132a9225d6a627094f5 (patch) | |
tree | 89e9e75b52d9cfc234391141c5ae0a5f42534c9c /source3/passdb/pdb_ldap.c | |
parent | 5e252c86bd97305f3c6578afb29ccd148f985e60 (diff) | |
download | samba-ffbb6ee3b8ee815e5e4f8132a9225d6a627094f5.tar.gz samba-ffbb6ee3b8ee815e5e4f8132a9225d6a627094f5.tar.bz2 samba-ffbb6ee3b8ee815e5e4f8132a9225d6a627094f5.zip |
Fix two memleaks in pdb_ldap.c.
Whoever put the private.backend_private_data_free_fn thingy into
SAM_ACCOUNT, could you please revisit my change to pdb_get_set.c and
comment on my comment there?
Thanks,
Volker
(This used to be commit 922ec277d1c80b5532f5cac0ee99ae7cd20f83f1)
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r-- | source3/passdb/pdb_ldap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 84ac6c576a..8f5efbbd64 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -104,7 +104,7 @@ struct ldapsam_privates { static void private_data_free_fn(void **result) { - ldap_memfree(*result); + ldap_msgfree(*result); *result = NULL; } @@ -1377,6 +1377,7 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A if (!init_ldap_from_sam(ldap_state, entry, &mods, newpwd, element_is_changed)) { DEBUG(0, ("ldapsam_update_sam_account: init_ldap_from_sam failed!\n")); + ldap_memfree(dn); return NT_STATUS_UNSUCCESSFUL; } @@ -1384,11 +1385,13 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A DEBUG(4,("mods is empty: nothing to update for user: %s\n", pdb_get_username(newpwd))); ldap_mods_free(mods, True); + ldap_memfree(dn); return NT_STATUS_OK; } ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,LDAP_MOD_REPLACE, element_is_changed); ldap_mods_free(mods,True); + ldap_memfree(dn); if (!NT_STATUS_IS_OK(ret)) { char *ld_error = NULL; |