[PATCH] Memory leak when deleting and re-adding device-mapper entries.

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

 



From: Konrad Rzeszutek <konrad@xxxxxxxxxxxxxxxxxxxx>

 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.

Signed-off-by: Konrad Rzeszutek <konrad@xxxxxxxxxxxxxxx>
---
 libmultipath/configure.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libmultipath/configure.c b/libmultipath/configure.c
index 285a8a2..83ee0ae 100644
--- a/libmultipath/configure.c
+++ b/libmultipath/configure.c
@@ -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);
-- 
1.5.4.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux