Skip to contentSkip to conversation

main - pvscan: free unused device_id

PATCH Zdenek Kabelac 1 participant 1 message Dec 20, 2022

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=edd6d84159f4d540c8283771da6702971518ccd7
Commit:        edd6d84159f4d540c8283771da6702971518ccd7
Parent:        8f091d379860cf71577629cc1f56191b5f418310
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Dec 20 14:17:34 2022 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Dec 20 15:04:36 2022 +0100

pvscan: free unused device_id

Fix memleak in function.

---
 tools/pvscan.c | 2 ++
 1 file changed, 2 insertions(+)
tools/pvscan.c +2 -0
index 96935a43b..773862227 100644
@@ -1441,6 +1441,8 @@ static void _warn_excluded_root(struct cmd_context *cmd, struct device *dev)
 
 	log_warn("WARNING: no autoactivation for %s: system.devices %s current %s.",
 		 dev_name(dev), du->idname, cur_idname ?: "missing device id");
+
+	free((void*) cur_idname);
 }
 
 static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,