[Cluster-devel] cluster/cmirror/src cluster.c

[email protected] <[email protected]>
Newsgroups com.redhat.cluster-devel
Message-ID <[email protected]>
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

--- cluster/cmirror/src/Attic/cluster.c	2008/01/18 17:11:07	1.1.2.9
+++ cluster/cmirror/src/Attic/cluster.c	2008/01/18 21:00:15	1.1.2.10
@@ -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;
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.