From f7dda0660713513bac2589fc16ccb8c77c6dbe63 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Tue, 18 Oct 2005 12:01:02 +0200 Subject: [PATCH] [multipath] fix a double free error "multipath $FLAGS $ALIAS" code path lead to a double free : 1) get_refwwid did a lookup in mptable and returned mpe->alias as the refwwid 2) in the exit path, we freed refwwid 3) then free_config()->free_mptable()->free_mpe() freed mpe->alias at the same address So return strdup(mpe->alias) instead. --- multipath/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multipath/main.c b/multipath/main.c index 5a2b2a8..a8e8f41 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -133,7 +133,7 @@ get_refwwid (vector pathvec) refwwid = get_mpe_wwid(conf->dev); if (refwwid) - return refwwid; + return STRDUP(refwwid); /* * or directly a wwid -- 2.7.4