Changeset
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Git apply log
Switched to a new branch '20180307144653.3890-1-jferlan@redhat.com'
Applying: qemu: Fix memory leak in qemuConnectGetAllDomainStats error path
To https://github.com/patchew-project/libvirt
 * [new tag]             patchew/20180307144653.3890-1-jferlan@redhat.com -> patchew/20180307144653.3890-1-jferlan@redhat.com
Test passed: syntax-check

loading

[libvirt] [PATCH] qemu: Fix memory leak in qemuConnectGetAllDomainStats error path
Posted by John Ferlan, 15 weeks ago
If we return -1 on VIR_ALLOC_N failure, we leaked @vms, so
goto cleanup instead.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9e715e7a0..e13544f83 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20348,7 +20348,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
     }
 
     if (VIR_ALLOC_N(tmpstats, nvms + 1) < 0)
-        return -1;
+        goto cleanup;
 
     if (qemuDomainGetStatsNeedMonitor(stats))
         privflags |= QEMU_DOMAIN_STATS_HAVE_JOB;
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Fix memory leak in qemuConnectGetAllDomainStats error path
Posted by Peter Krempa, 15 weeks ago
On Wed, Mar 07, 2018 at 09:46:53 -0500, John Ferlan wrote:
> If we return -1 on VIR_ALLOC_N failure, we leaked @vms, so
> goto cleanup instead.
> 
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/qemu/qemu_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list