From 1bde35e596536abc176cb70506353476cd1705b1 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 29 Jan 2020 16:55:49 +0100 Subject: [PATCH] pvck: avoid memleak of vgname clang: no vgname buffer leak. --- tools/pvck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/pvck.c b/tools/pvck.c index 02662184f..d57e02646 100644 --- a/tools/pvck.c +++ b/tools/pvck.c @@ -788,7 +788,7 @@ static int _dump_current_text(struct device *dev, { char *meta_buf; struct dm_config_tree *cft; - const char *vgname = NULL; + char *vgname = NULL; uint32_t crc; uint32_t seqno = 0; int mn = mda_num; /* 1 or 2 */ @@ -895,6 +895,7 @@ static int _dump_current_text(struct device *dev, out: free(meta_buf); + free(vgname); if (bad) return 0; return 1; -- 2.43.5