]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix memory leak while starting a guest
authorPavel Hrdina <phrdina@redhat.com>
Tue, 24 Feb 2015 13:31:37 +0000 (14:31 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 24 Feb 2015 15:38:50 +0000 (16:38 +0100)
In commit cc41c648 I've re-factored qemuMonitorFindBalloonObjectPath, but
missed that there is a memory leak. The "nextpath" variable is
overwritten while looping in for cycle and we have to free it before next
cycle.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_monitor.c

index 6882a50479e492fd1e12f38f08acedaf49da7920..94495cd7179b242e02434cd922bb6a7776ad381d 100644 (file)
@@ -1067,6 +1067,7 @@ qemuMonitorFindObjectPath(qemuMonitorPtr mon,
             }
 
             ret = qemuMonitorFindObjectPath(mon, nextpath, name, path);
+            VIR_FREE(nextpath);
         }
     }