]> sourceware.org Git - lvm2.git/commitdiff
cov: Fix memory leak
authorMarian Csontos <mcsontos@redhat.com>
Wed, 28 Aug 2019 08:45:04 +0000 (10:45 +0200)
committerMarian Csontos <mcsontos@redhat.com>
Wed, 23 Oct 2019 07:51:55 +0000 (09:51 +0200)
libdm/libdm-common.c

index d17c284f2e031746b3b83cd1f35509f92a9b5f3f..d75c7046c811e3b755a00a667c09c7758ef22b1e 100644 (file)
@@ -2011,7 +2011,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;
        }
@@ -2032,6 +2033,7 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz
        strcpy(buf, name);
        r = 1;
 bad:
+out:
        dm_free(temp_buf);
        dm_free(sysfs_path);
 
This page took 0.035379 seconds and 5 git commands to generate.