ldap/servers/plugins/replication/windows_protocol_util.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 576d90b25524b06dad4b5497fc6f7e5e673c8899
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Thu Sep 1 09:41:06 2011 -0700
Bug 722292 - (cov#11030) Leak of mapped_sdn in winsync rename code
The previous fix for bug 722292 introduced a memory leak of the
mapped DN used to detect entry renames. This ensures that we
free the mapped DN.
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c
b/ldap/servers/plugins/replication/windows_protocol_util.c
index a1c8c0d..771475b 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -4509,7 +4509,7 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
newrdn ? newrdn:"NULL", newsuperior ? newsuperior:"NULL");
slapi_ch_free_string(&newsuperior);
slapi_rdn_done(&rdn);
- return retval;
+ goto bail;
}
slapi_ch_free_string(&newsuperior);
slapi_rdn_done(&rdn);
@@ -4524,10 +4524,12 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
"failed to get local entry \"%s\" after rename\n",
slapi_sdn_get_ndn(mapped_sdn));
local_entry = orig_local_entry;
- return retval;
+ orig_local_entry = NULL;
+ goto bail;
}
}
+
slapi_mods_init (&smods, 0);
retval =
windows_generate_update_mods(prp,remote_entry,local_entry,0,&smods,&do_modify);
@@ -4566,6 +4568,9 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry
*remote_entry,
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"no mods generated for local entry: %s\n", escape_string(dn, dnbuf));
}
+
+bail:
+ slapi_sdn_free(&mapped_sdn);
slapi_mods_done(&smods);
if (orig_local_entry) {
slapi_entry_free(local_entry);
Show replies by date