From f6bd0a88997e25e4efed527ac336f38975bc8fab Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 4 Dec 2012 13:16:07 +0000 Subject: [PATCH] Fix memory leak in QEMU QMP capabilities initialization The qemuCapsInitQMP method never frees the QEMU 'package' version string. --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 98e65f16c0..4ebba042f5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2298,7 +2298,7 @@ qemuCapsInitQMP(qemuCapsPtr caps, virCommandPtr cmd = NULL; qemuMonitorPtr mon = NULL; int major, minor, micro; - char *package; + char *package = NULL; int status = 0; virDomainChrSourceDef config; char *monarg = NULL; @@ -2442,6 +2442,7 @@ cleanup: virCommandFree(cmd); VIR_FREE(monarg); VIR_FREE(monpath); + VIR_FREE(package); if (pidfile) { char ebuf[1024];