提交 6fabe2f2 编写于 作者: Z Zhang Bo 提交者: Ján Tomko

util: fix memleak in virFindSCSIHostByPCI

free buf in cleanup.
Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
上级 083ac198
......@@ -1815,6 +1815,8 @@ virFindSCSIHostByPCI(const char *sysfs_prefix,
if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
goto cleanup;
VIR_FREE(buf);
if (read_unique_id != unique_id) {
VIR_FREE(unique_path);
continue;
......@@ -1829,6 +1831,7 @@ virFindSCSIHostByPCI(const char *sysfs_prefix,
VIR_FREE(unique_path);
VIR_FREE(host_link);
VIR_FREE(host_path);
VIR_FREE(buf);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册