提交 0a8bd97a 编写于 作者: Z Zhang Bo 提交者: Ján Tomko

qemu: fix memleaks in qemuBuildCommandLine

free boot_opts_str and boot_order_str both in normal and error paths.
Signed-off-by: NZhang Bo <oscar.zhangbo@huawei.com>
上级 6fabe2f2
......@@ -9266,6 +9266,7 @@ qemuBuildCommandLine(virConnectPtr conn,
}
}
VIR_FREE(boot_opts_str);
VIR_FREE(boot_order_str);
if (def->os.kernel)
virCommandAddArgList(cmd, "-kernel", def->os.kernel, NULL);
......@@ -10746,6 +10747,7 @@ qemuBuildCommandLine(virConnectPtr conn,
error:
VIR_FREE(boot_order_str);
VIR_FREE(boot_opts_str);
virBufferFreeAndReset(&boot_buf);
virObjectUnref(cfg);
/* free up any resources in the network driver
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册