]> sourceware.org Git - lvm2.git/commitdiff
cov: fix memory leak
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 14 Nov 2019 15:23:38 +0000 (16:23 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 14 Nov 2019 17:05:41 +0000 (18:05 +0100)
Reapply 23cc7ddc50e2800a6dc248de897a4c88c1514160 to internal version
of libdm.

device_mapper/libdm-common.c

index 1cb29f1e895e6d3cdf33dfb375fe1bcfd7aa9dc5..bc691d62977026d9854686794928f2a63214383f 100644 (file)
@@ -2012,7 +2012,8 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz
                        log_sys_error("readlink", sysfs_path);
                else {
                        log_sys_debug("readlink", sysfs_path);
-                       return _sysfs_find_kernel_name(major, minor, buf, buf_size);
+                       r = _sysfs_find_kernel_name(major, minor, buf, buf_size);
+                       goto out;
                }
                goto bad;
        }
@@ -2033,6 +2034,7 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz
        strcpy(buf, name);
        r = 1;
 bad:
+out:
        free(temp_buf);
        free(sysfs_path);
 
This page took 0.037885 seconds and 5 git commands to generate.