mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-04 21:47:16 +03:00
util: fix memleak in virFindSCSIHostByPCI
free buf in cleanup. Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
parent
083ac198bc
commit
6fabe2f227
@ -1815,6 +1815,8 @@ virFindSCSIHostByPCI(const char *sysfs_prefix,
|
|||||||
if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
|
if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
VIR_FREE(buf);
|
||||||
|
|
||||||
if (read_unique_id != unique_id) {
|
if (read_unique_id != unique_id) {
|
||||||
VIR_FREE(unique_path);
|
VIR_FREE(unique_path);
|
||||||
continue;
|
continue;
|
||||||
@ -1829,6 +1831,7 @@ virFindSCSIHostByPCI(const char *sysfs_prefix,
|
|||||||
VIR_FREE(unique_path);
|
VIR_FREE(unique_path);
|
||||||
VIR_FREE(host_link);
|
VIR_FREE(host_link);
|
||||||
VIR_FREE(host_path);
|
VIR_FREE(host_path);
|
||||||
|
VIR_FREE(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user