From: Zhang Bo Date: Mon, 27 Apr 2015 06:41:42 +0000 (+0800) Subject: qemu: fix memleaks in qemuBuildCommandLine X-Git-Tag: v1.2.15-rc1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a8bd97afa27a54d373c48b23cf59676dfd601a5;p=thirdparty%2Flibvirt.git qemu: fix memleaks in qemuBuildCommandLine free boot_opts_str and boot_order_str both in normal and error paths. Signed-off-by: Zhang Bo --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 29b876ee18..a54f3a3230 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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