From 7ec97ed5f2b95585eb1538ee6edeedb7275101eb Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Wed, 12 Jul 2023 14:15:41 +0200
Subject: [PATCH] cov: fix memleak in vgchange

Release allocated  vgname from get_single_vgname_cmd_arg()
when it is not returned via *vgname_ret.

---
 tools/vgchange.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/vgchange.c b/tools/vgchange.c
index 63861b5..7a53a7f 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -863,6 +863,8 @@ static int _vgchange_autoactivation_setup(struct cmd_context *cmd,
 		*flags &= ~READ_WITHOUT_LOCK;
 		cmd->can_use_one_scan = 0;
 	}
+
+	free(vgname);
 	return 1;
 
 }
-- 
2.27.0

