All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - pvck: avoid memleak of vgname
Date: Tue, 4 Feb 2020 11:22:32 -0500	[thread overview]
Message-ID: <00627.120020411222701807@us-mta-218.us.mimecast.lan> (raw)

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;




                 reply	other threads:[~2020-02-04 16:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00627.120020411222701807@us-mta-218.us.mimecast.lan \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.