ldap/servers/plugins/replication/csnpl.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 12567ffd8c5504cd3ba7dc7783e7ca1f237c82be
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri May 18 15:13:16 2012 -0600
Trac Ticket #359 - Database RUV could mismatch the one in changelog under the stress
https://fedorahosted.org/389/ticket/359
Fix Description:
. Fix for csnplRollUp - was leaking the node data - since
llistRemoveCurrentAndGetNext will detach the current node,
we have to free the data associated with the current node
first, but not the csn, so set that to NULL first
Reviewed by: nhosoi (Thanks!)
diff --git a/ldap/servers/plugins/replication/csnpl.c
b/ldap/servers/plugins/replication/csnpl.c
index 16cebf1..b3c2ffd 100644
--- a/ldap/servers/plugins/replication/csnpl.c
+++ b/ldap/servers/plugins/replication/csnpl.c
@@ -101,9 +101,8 @@ CSNPL* csnplNew ()
void
-csnpldata_free(void **data)
+csnpldata_free(csnpldata **data_to_free)
{
- csnpldata **data_to_free = (csnpldata **)data;
if (NULL != data_to_free)
{
if (NULL != (*data_to_free)->csn)
@@ -319,6 +318,10 @@ csnplRollUp(CSNPL *csnpl, CSN **first_commited)
*first_commited = data->csn;
freeit = PR_FALSE;
}
+ /* llistRemoveCurrentAndGetNext will detach the current node
+ so we have to free the data associated with it, but not the csn */
+ data->csn = NULL;
+ csnpldata_free(&data);
data = (csnpldata *)llistRemoveCurrentAndGetNext(csnpl->csnList, &iterator);
} else {
data = (csnpldata *)llistGetNext (csnpl->csnList, &iterator);