Skip to contentSkip to conversation

main - filters: fix memleak on mpath filter destroy

PATCH Zdenek Kabelac 1 participant 1 message Sep 13, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=30050769b1490e293d9e0f7ed37d83c3e56bb6b3
Commit:        30050769b1490e293d9e0f7ed37d83c3e56bb6b3
Parent:        3b24c0fe4e197383101eae53b14f19586cf2eda1
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Sep 12 16:13:27 2021 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Sep 13 12:34:41 2021 +0200

filters: fix memleak on mpath filter destroy

Missing free() leaks filter structure.

---
 WHATS_NEW                  | 1 +
 lib/filters/filter-mpath.c | 2 ++
 2 files changed, 3 insertions(+)
WHATS_NEW +1 -0
index 7d4cea1d6..9ff0be667 100644
@@ -1,5 +1,6 @@
 Version 2.03.14 - 
 ==================================
+  Fix memleak in mpath filter.
   Support newer location for VDO statistics.
   Add support for VDO async-unsage write policy.
   Improve lvm_import_vdo script.
lib/filters/filter-mpath.c +2 -0
index 982e23400..7644a5b0a 100644
@@ -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)