Skip to contentSkip to conversation

cluster/cmirror/src cluster.c

Cluster-devel [email protected] 1 participant 1 message Jan 18, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: jbrassow at sourceware.org 2008-01-18 21:00:16

Modified files:
cmirror/src : cluster.c

Log message:
- fix seg fault if there are pending checkpoint requests when a mirror is shutdown.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror/src/cluster.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.9&r2=1.1.2.10

cmirror/src/Attic/cluster.c +7 -1
@@ -46,6 +46,7 @@
 
 	/* Are we the first, or have we received checkpoint? */
 	int valid;
+	int free_me;
 	struct queue *startup_queue;
 
 	int checkpoints_needed;
@@ -578,6 +579,11 @@
 		if (r != SA_AIS_OK)
 			LOG_ERROR("cpg_dispatch failed: %d", r);
 
+		if (entry->free_me) {
+			free(entry);
+			continue;
+		}
+
 		for (cp = entry->checkpoint_list; cp;) {
 			LOG_ERROR("Checkpoint data available for node %u",
 				  cp->requester);
@@ -810,7 +816,7 @@
 				LOG_ERROR("Startup items remain in cluster log");
 
 			free(match->startup_queue);
-			free(match);
+			match->free_me = 1;
 
 			goto out;
 		}