Blob Blame History Raw
From 4d5df2d0bc0978d0eac6f8700b89ac4f80fdd914 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Sun, 12 Sep 2021 16:13:27 +0200
Subject: [PATCH] filters: fix memleak on mpath filter destroy

Missing free() leaks filter structure.

(cherry picked from commit 30050769b1490e293d9e0f7ed37d83c3e56bb6b3)
---
 WHATS_NEW                  | 1 +
 lib/filters/filter-mpath.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/WHATS_NEW b/WHATS_NEW
index 958e745..91cfc52 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.03.14 - 
 ==================================
+  Fix memleak in mpath filter.
   Support newer location for VDO statistics.
 
 Version 2.03.13 - 11th August 2021
diff --git a/lib/filters/filter-mpath.c b/lib/filters/filter-mpath.c
index 982e234..7644a5b 100644
--- a/lib/filters/filter-mpath.c
+++ b/lib/filters/filter-mpath.c
@@ -37,6 +37,8 @@ static void _destroy(struct dev_filter *f)
 {
 	if (f->use_count)
 		log_error(INTERNAL_ERROR "Destroying mpath filter while in use %u times.", f->use_count);
+
+	free(f);
 }
 
 struct dev_filter *mpath_filter_create(struct dev_types *dt)
-- 
1.8.3.1