소스 검색

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);