mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Fix memory leak in qemuConnectGetAllDomainStats error path
If we return -1 on VIR_ALLOC_N failure, we leaked @vms, so goto cleanup instead. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
6a59d6c103
commit
4b1ec66cde
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user