summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2009-02-19 23:39:50 +0000
committerRich Megginson <rmeggins@redhat.com>2009-02-19 23:39:50 +0000
commitc39efbf86a562f655e9170a1644fc979bad0c597 (patch)
tree9407d8f8ce88e50f92f4ed41651cca76c7afc315 /ldap/servers/plugins
parent01426a0ecc6fd62ed74e0f606a56a80da9fc2a6b (diff)
downloadds-c39efbf86a562f655e9170a1644fc979bad0c597.tar.gz
ds-c39efbf86a562f655e9170a1644fc979bad0c597.tar.xz
ds-c39efbf86a562f655e9170a1644fc979bad0c597.zip
Resolves: bug 486191
Description: slapd hang during cs80 cloning setup. Fix Description: Not exactly related to the bug, but Noriko found a couple of places during investigation of internal add operations where the Slapi_Entry* could be leaked upon error. These fixes ensure that the entry is properly freed in case of error.
Diffstat (limited to 'ldap/servers/plugins')
-rw-r--r--ldap/servers/plugins/replication/cl4_api.c4
-rw-r--r--ldap/servers/plugins/replication/windows_protocol_util.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ldap/servers/plugins/replication/cl4_api.c b/ldap/servers/plugins/replication/cl4_api.c
index 07bf7b24..c7d0ce02 100644
--- a/ldap/servers/plugins/replication/cl4_api.c
+++ b/ldap/servers/plugins/replication/cl4_api.c
@@ -263,7 +263,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op)
{
int rc = CL4_SUCCESS, res;
char *changeEntryDN, *timeStr;
- Slapi_Entry *e;
+ Slapi_Entry *e = NULL;
Slapi_PBlock *pb = NULL;
Slapi_Value *values[3];
char s[CSN_STRSIZE];
@@ -364,6 +364,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op)
pb = slapi_pblock_new (pb);
slapi_add_entry_internal_set_pb (pb, e, NULL, repl_get_plugin_identity (PLUGIN_LEGACY_REPLICATION), 0);
slapi_add_internal_pb (pb);
+ e = NULL; /* add consumes entry */
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
slapi_pblock_destroy(pb);
@@ -380,6 +381,7 @@ static int _cl4WriteOperation (const slapi_operation_parameters *op)
}
done:
+ slapi_entry_free(e);
if (changeEntryDN)
slapi_ch_free((void **) &changeEntryDN);
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 8cd5bdfa..ed5b8a32 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -3477,6 +3477,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
pb = slapi_pblock_new();
slapi_add_entry_internal_set_pb(pb, local_entry, NULL,repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),0);
slapi_add_internal_pb(pb);
+ local_entry = NULL; /* consumed by add */
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
if (retval) {
@@ -3484,6 +3485,7 @@ windows_create_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
"add operation of entry %s returned: %d\n", slapi_sdn_get_dn(local_sdn), retval);
}
error:
+ slapi_entry_free(local_entry);
slapi_ch_free_string(&guid_str);
if (pb)
{