From 0a8bd97afa27a54d373c48b23cf59676dfd601a5 Mon Sep 17 00:00:00 2001 From: Zhang Bo Date: Mon, 27 Apr 2015 14:41:42 +0800 Subject: [PATCH] qemu: fix memleaks in qemuBuildCommandLine free boot_opts_str and boot_order_str both in normal and error paths. Signed-off-by: Zhang Bo --- src/qemu/qemu_command.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- GitLab