[lib] Memory leak when deleting and re-adding device-mapper entries.
authorKonrad Rzeszutek <konrad@virtualiron.com>
Wed, 17 Dec 2008 22:24:40 +0000 (23:24 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 17 Dec 2008 22:24:40 +0000 (23:24 +0100)
If we remove a map (with configuration details specified in the multipath.conf file)
and later re-add it, the pointer to the config is over-written without first
de-allocating the values.

libmultipath/configure.c

index 285a8a2..83ee0ae 100644 (file)
@@ -50,6 +50,11 @@ setup_map (struct multipath * mpp)
        }
 
        /*
+        * free features, selector, and hwhandler properties if they are being reused
+        */
+       free_multipath_attributes(mpp);
+
+       /*
         * properties selectors
         */
        select_pgfailback(mpp);