summaryrefslogtreecommitdiff
path: root/multipathd
diff options
context:
space:
mode:
authorKonrad Rzeszutek <konrad@virtualiron.com>2008-12-17 23:23:09 +0100
committerChristophe Varoqui <christophe.varoqui@free.fr>2008-12-17 23:23:09 +0100
commitd431ffaf68794125280b623ef202ccebe9be61e7 (patch)
tree06c2de9d2711a61b1843c7f6d287210de88613c1 /multipathd
parent01012e0cb0cf09c0bb2c074307c7ec5ff48d4752 (diff)
downloadmultipath-tools-d431ffaf68794125280b623ef202ccebe9be61e7.tar.gz
multipath-tools-d431ffaf68794125280b623ef202ccebe9be61e7.tar.bz2
multipath-tools-d431ffaf68794125280b623ef202ccebe9be61e7.zip
[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.
Diffstat (limited to 'multipathd')
-rw-r--r--multipathd/main.c3
1 files changed, 3 insertions, 0 deletions
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;
}