[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] Segfault running multipath -d -v 3 at HOL



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
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: ***
+ */

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]