mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Fix memory leak in qemuDomainUpdateMemoryDeviceInfo
The @meminfo allocated in qemuMonitorGetMemoryDeviceInfo() may be lost when qemuDomainObjExitMonitor() failed. Signed-off-by: Yi Wang <wang.yi59@zte.com.cn> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2c8e30ee7e
commit
c679e8a41d
@ -5767,8 +5767,10 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
|
rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
|
||||||
|
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
|
||||||
|
virHashFree(meminfo);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* if qemu doesn't support the info request, just carry on */
|
/* if qemu doesn't support the info request, just carry on */
|
||||||
if (rc == -2)
|
if (rc == -2)
|
||||||
|
Loading…
Reference in New Issue
Block a user