From d431ffaf68794125280b623ef202ccebe9be61e7 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Date: Wed, 17 Dec 2008 23:23:09 +0100 Subject: [PATCH] [multipathd] Memory leak in ev_add_map. When using dm_mapname it makes a strdup of the returned value. We use the dm_mapname return value (alias) in our function but neglected to free it at the exit points. --- multipathd/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/multipathd/main.c b/multipathd/main.c index 30dba5b..e8a2660 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -243,6 +243,7 @@ ev_add_map (struct sysfs_device * dev, struct vectors * vecs) if (map_present && dm_type(alias, TGT_MPATH) <= 0) { condlog(4, "%s: not a multipath map", alias); + FREE(alias); return 0; } @@ -256,6 +257,7 @@ ev_add_map (struct sysfs_device * dev, struct vectors * vecs) */ condlog(0, "%s: devmap already registered", dev->kernel); + FREE(alias); return 0; } @@ -280,6 +282,7 @@ ev_add_map (struct sysfs_device * dev, struct vectors * vecs) condlog(0, "%s: uev_add_map %s failed", alias, dev->kernel); FREE(refwwid); + FREE(alias); return r; } -- 2.7.4