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

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



From: Konrad Rzeszutek <konrad mars virtualiron com>

 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 virtualiron com>
---
 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


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