From 658099b6950210e131dcb3d20fa022d5ce5a22f7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Jul 2003 13:57:53 +0000 Subject: Fix memleak (This used to be commit 42a59d691019ee328920be25a1c505037f74151f) --- source3/passdb/pdb_ldap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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", -- cgit