summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-31 19:16:59 +0000
committerJeremy Allison <jra@samba.org>2003-10-31 19:16:59 +0000
commit732fecd3a0f6b07e79549940f3d10fefa1e221df (patch)
tree8f108581bb46c6476d142dbc242b2789b7c9cb15 /source3/passdb
parentff700f3303f5f9912866d8f478f0a5877a35cce9 (diff)
downloadsamba-732fecd3a0f6b07e79549940f3d10fefa1e221df.tar.gz
samba-732fecd3a0f6b07e79549940f3d10fefa1e221df.tar.bz2
samba-732fecd3a0f6b07e79549940f3d10fefa1e221df.zip
Patch from Aurélien Degrémont <adegremont@idealx.com>. "entry" is dependent
on "result", don't free result first. Jeremy. (This used to be commit c61a230c5ab7250c0812b422e0a533fbf5efbf17)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index e0148494d3..9299ca2e50 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1983,21 +1983,22 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
return NT_STATUS_UNSUCCESSFUL;
}
- ldap_msgfree(result);
-
if (mods == NULL) {
DEBUG(4, ("ldapsam_update_group_mapping_entry: mods is empty: nothing to do\n"));
+ ldap_msgfree(result);
return NT_STATUS_OK;
}
dn = smbldap_get_dn(ldap_state->smbldap_state->ldap_struct, entry);
if (!dn) {
+ ldap_msgfree(result);
return NT_STATUS_UNSUCCESSFUL;
}
rc = smbldap_modify(ldap_state->smbldap_state, dn, mods);
SAFE_FREE(dn);
ldap_mods_free(mods, True);
+ ldap_msgfree(result);
if (rc != LDAP_SUCCESS) {
char *ld_error = NULL;
@@ -2006,6 +2007,7 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods,
DEBUG(0, ("ldapsam_update_group_mapping_entry: failed to modify group %lu error: %s (%s)\n", (unsigned long)map->gid,
ld_error ? ld_error : "(unknown)", ldap_err2string(rc)));
SAFE_FREE(ld_error);
+ return NT_STATUS_UNSUCCESSFUL;
}
DEBUG(2, ("ldapsam_update_group_mapping_entry: successfully modified group %lu in LDAP\n", (unsigned long)map->gid));