All of lore.kernel.org
 help / color / mirror / Atom feed
* Segfault running multipath -d -v 3 at HOL
@ 2006-04-13  0:02 Brian Wong
  2006-04-13 21:06 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Wong @ 2006-04-13  0:02 UTC (permalink / raw)
  To: dm-devel

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

Hi Christophe,

I'm seeing a segfault running `multipath -d -v 3` at HOL.  Here's the
fix for the issue.  It might be worth applying similar logic fixes to
the rest of the free_x() calls in free_config(); let me know if you want
that patch too.

cheers,

brian

[-- Attachment #2: diff.out --]
[-- Type: text/x-patch, Size: 1110 bytes --]

diff --git a/libmultipath/config.c b/libmultipath/config.c
index c9d6172..928bfea 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -305,7 +305,8 @@ free_config (struct config * conf)
 	free_blacklist_device(conf->blist_device);
 	free_mptable(conf->mptable);
 	free_hwtable(conf->hwtable);
-	free_keywords(conf->keywords);
+	if (conf->keywords)
+		free_keywords(conf->keywords);
 	FREE(conf);
 }
 
diff --git a/libmultipath/parser.c b/libmultipath/parser.c
index 385e4fb..bb04968 100644
--- a/libmultipath/parser.c
+++ b/libmultipath/parser.c
@@ -18,6 +18,7 @@
  */
 
 #include <syslog.h>
+#include <assert.h>
 
 #include "parser.h"
 #include "memory.h"
@@ -110,6 +111,9 @@ free_keywords(vector keywords)
 	struct keyword *keyword;
 	int i;
 
+	assert(keywords);
+	if (!keywords) return;
+
 	for (i = 0; i < VECTOR_SIZE(keywords); i++) {
 		keyword = VECTOR_SLOT(keywords, i);
 		if (keyword->sub)
@@ -483,3 +487,11 @@ init_data(char *conf_file, void (*init_k
 
 	return r;
 }
+
+/*
+ * Local Variables: ***
+ * mode:c ***
+ * c-basic-offset:8 ***
+ * indent-tabs-mode:1 ***
+ * End: ***
+ */

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-13 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-13  0:02 Segfault running multipath -d -v 3 at HOL Brian Wong
2006-04-13 21:06 ` Christophe Varoqui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.