Skip to contentSkip to conversation

cluster/rgmanager/src/daemons rg_thread.c

Cluster-devel [email protected] 1 participant 1 message Nov 27, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2006-11-27 22:32:05

Modified files:
rgmanager/src/daemons: rg_thread.c

Log message:
Fix #213878 - segfault in rg_thread.c due to improper loop semantics

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_thread.c.diff?cvsroot=cluster&r1=1.15&r2=1.16

rgmanager/src/daemons/rg_thread.c +12 -8
@@ -111,18 +111,22 @@
 purge_status_checks(request_t **list)
 {
 	request_t *curr;
+	int found;
 	
 	if (!list)
 		return;
 
-	list_do(list, curr) {
-		if (curr->rr_request != RG_STATUS)
-			continue;
-
-		list_remove(list, curr);
-		rq_free(curr);
-		curr = *list;
-	} while (!list_done(list, curr));
+	do {
+		found = 0;
+		list_do(list, curr) {
+			if (curr->rr_request == RG_STATUS) {
+				list_remove(list, curr);
+				rq_free(curr);
+				found = 1;
+				break;
+			}
+		} while (!list_done(list, curr));
+	} while (found);
 }