]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid; fix memory leak in blkid_probe_get_wholedisk_probe()
authorKarel Zak <kzak@redhat.com>
Wed, 21 Dec 2011 16:32:01 +0000 (17:32 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 21 Dec 2011 16:32:01 +0000 (17:32 +0100)
Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/probe.c

index 27d9b272f78e67c740ec488da5ff92ea9d63824d..cb56c5afa2a0b25a7be0feab6bfe4a7554579df5 100644 (file)
@@ -1341,6 +1341,9 @@ blkid_probe blkid_probe_get_wholedisk_probe(blkid_probe pr)
                DBG(DEBUG_LOWPROBE, printf("allocate a wholedisk probe\n"));
 
                pr->disk_probe = blkid_new_probe_from_filename(disk_path);
+
+               free(disk_path);
+
                if (!pr->disk_probe)
                        return NULL;    /* ENOMEM? */
        }