[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] Fix memory leak in QEMU QMP capabilities initialization



From: "Daniel P. Berrange" <berrange redhat com>

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 6e34cdf..a0ed4f1 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2299,7 +2299,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;
@@ -2443,6 +2443,7 @@ cleanup:
     virCommandFree(cmd);
     VIR_FREE(monarg);
     VIR_FREE(monpath);
+    VIR_FREE(package);
 
     if (pidfile) {
         char ebuf[1024];
-- 
1.7.11.7


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]