]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: fix memory leak on -machine usage error
authorEric Blake <eblake@redhat.com>
Wed, 3 Apr 2013 17:26:41 +0000 (11:26 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 3 Apr 2013 17:55:18 +0000 (11:55 -0600)
Commit f84b92ea introduced a memory leak on error; John Ferlan reported
that valgrind caught it during 'make check'.

* src/qemu/qemu_command.c (qemuBuildMachineArgStr): Plug leak.

src/qemu/qemu_command.c

index 693d30da47db6bf6c18b4635c4c6876f1814f39d..29424d6d8077855387c2f2514f434576cb8874bf 100644 (file)
@@ -5228,6 +5228,7 @@ qemuBuildMachineArgStr(virCommandPtr cmd,
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("dump-guest-core is not available "
                                  "with this QEMU binary"));
+                virBufferFreeAndReset(&buf);
                 return -1;
             }