From: Eric Blake Date: Wed, 3 Apr 2013 17:26:41 +0000 (-0600) Subject: qemu: fix memory leak on -machine usage error X-Git-Tag: v1.0.5-rc1~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e52a31d16688139175087bfff11f62a6ce95936d;p=thirdparty%2Flibvirt.git qemu: fix memory leak on -machine usage error 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. --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 693d30da47..29424d6d80 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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; }