1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: Fix memory leak

This commit is contained in:
Marian Csontos 2019-08-28 10:45:04 +02:00
parent 3e3c78a6b0
commit 23cc7ddc50

View 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); log_sys_error("readlink", sysfs_path);
else { else {
log_sys_debug("readlink", sysfs_path); 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; goto bad;
} }
@ -2032,6 +2033,7 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz
strcpy(buf, name); strcpy(buf, name);
r = 1; r = 1;
bad: bad:
out:
dm_free(temp_buf); dm_free(temp_buf);
dm_free(sysfs_path); dm_free(sysfs_path);