]> sourceware.org Git - lvm2.git/commitdiff
pvck: avoid memleak of vgname
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 29 Jan 2020 15:55:49 +0000 (16:55 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 4 Feb 2020 16:22:06 +0000 (17:22 +0100)
clang: no vgname buffer leak.

tools/pvck.c

index 02662184f25c47f368ad99c87da8f24b659f1803..d57e0264640ffa4fd9d1ef02f5ec21cfbffd6f53 100644 (file)
@@ -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;
This page took 1.49304 seconds and 5 git commands to generate.