Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1289
Modified Files:
cl4_api.c
Log Message:
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.
Index: cl4_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl4_api.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cl4_api.c 10 Nov 2006 23:45:17 -0000 1.6
+++ cl4_api.c 19 Feb 2009 23:39:14 -0000 1.7
@@ -263,7 +263,7 @@
{
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 @@
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 @@
}
done:
+ slapi_entry_free(e);
if (changeEntryDN)
slapi_ch_free((void **) &changeEntryDN);
Show replies by thread