diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index d17c284f2..d75c7046c 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -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);