All of lore.kernel.org
 help / color / mirror / Atom feed
* master - pvck: avoid memleak of vgname
@ 2020-02-04 16:22 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2020-02-04 16:22 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1bde35e596536abc176cb70506353476cd1705b1
Commit:        1bde35e596536abc176cb70506353476cd1705b1
Parent:        ac38b576f9f6daedf22a0d8472586bfe7de7c57e
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Wed Jan 29 16:55:49 2020 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Feb 4 17:22:06 2020 +0100

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 0266218..d57e026 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;




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-04 16:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 16:22 master - pvck: avoid memleak of vgname Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.