]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: fix memleaks in qemuBuildCommandLine
authorZhang Bo <oscar.zhangbo@huawei.com>
Mon, 27 Apr 2015 06:41:42 +0000 (14:41 +0800)
committerJán Tomko <jtomko@redhat.com>
Mon, 27 Apr 2015 08:04:38 +0000 (10:04 +0200)
free boot_opts_str and boot_order_str both in normal and error paths.

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
src/qemu/qemu_command.c

index 29b876ee183ef37f18234e7ac004ff1a41e15b23..a54f3a3230bc804f28199d33bdd96f4bbb51e869 100644 (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