diff options
author | Volker Lendecke <vlendec@samba.org> | 2003-07-16 13:57:53 +0000 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2003-07-16 13:57:53 +0000 |
commit | 658099b6950210e131dcb3d20fa022d5ce5a22f7 (patch) | |
tree | a47fe6b4154520fd9c3ad5d2ad8595db082cf91e | |
parent | 36d1df4413d33df94bf20bb50e7d796bc72399fc (diff) | |
download | samba-658099b6950210e131dcb3d20fa022d5ce5a22f7.tar.gz samba-658099b6950210e131dcb3d20fa022d5ce5a22f7.tar.bz2 samba-658099b6950210e131dcb3d20fa022d5ce5a22f7.zip |
Fix memleak
(This used to be commit 42a59d691019ee328920be25a1c505037f74151f)
-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 17803a37ed..84ac6c576a 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -1897,13 +1897,16 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods, rc = ldapsam_search_one_group_by_gid(ldap_state, map->gid, &result); if (rc != LDAP_SUCCESS) { + ldap_msgfree(result); return NT_STATUS_UNSUCCESSFUL; } count = ldap_count_entries(ldap_state->smbldap_state->ldap_struct, result); - if ( count == 0 ) + if ( count == 0 ) { + ldap_msgfree(result); return NT_STATUS_UNSUCCESSFUL; + } if (count > 1) { DEBUG(2, ("Group %i must exist exactly once in LDAP\n", |