qemu: fix memleaks in qemuBuildCommandLine

free boot_opts_str and boot_order_str both in normal and error paths.

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
Zhang Bo 2015-04-27 14:41:42 +08:00 committed by Ján Tomko
parent 6fabe2f227
commit 0a8bd97afa

View File

@ -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