瀏覽代碼

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!)
Rich Megginson 13 年之前
父節點
當前提交
12567ffd8c
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      ldap/servers/plugins/replication/csnpl.c

+ 5 - 2
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);