[libvirt] [PATCH] qemu: fix memory leak while starting a guest

In commit cc41c648 I've re-factored qemuMonitorFindBalloonObjectPath, but missed that there is a memory leak. The "nextpath" variable is overridden 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6882a50..94495cd 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1067,6 +1067,7 @@ qemuMonitorFindObjectPath(qemuMonitorPtr mon, } ret = qemuMonitorFindObjectPath(mon, nextpath, name, path); + VIR_FREE(nextpath); } } -- 2.0.5

On Tue, Feb 24, 2015 at 15:00:49 +0100, Pavel Hrdina wrote:
In commit cc41c648 I've re-factored qemuMonitorFindBalloonObjectPath, but missed that there is a memory leak. The "nextpath" variable is overridden while looping in for cycle and we have to free it before next
overwritten
cycle.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6882a50..94495cd 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1067,6 +1067,7 @@ qemuMonitorFindObjectPath(qemuMonitorPtr mon, }
ret = qemuMonitorFindObjectPath(mon, nextpath, name, path); + VIR_FREE(nextpath); } }
ACK for 1.2.13, Peter

On Tue, Feb 24, 2015 at 03:56:18PM +0100, Peter Krempa wrote:
On Tue, Feb 24, 2015 at 15:00:49 +0100, Pavel Hrdina wrote:
In commit cc41c648 I've re-factored qemuMonitorFindBalloonObjectPath, but missed that there is a memory leak. The "nextpath" variable is overridden while looping in for cycle and we have to free it before next
overwritten
cycle.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6882a50..94495cd 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1067,6 +1067,7 @@ qemuMonitorFindObjectPath(qemuMonitorPtr mon, }
ret = qemuMonitorFindObjectPath(mon, nextpath, name, path); + VIR_FREE(nextpath); } }
ACK for 1.2.13,
Peter
Pushed now, thanks. Pavel
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (2)
-
Pavel Hrdina
-
Peter Krempa