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:
Yi Wang 2017-05-24 22:20:16 -04:00 committed by Michal Privoznik
parent 2c8e30ee7e
commit c679e8a41d

View File

@ -5767,8 +5767,10 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver,
rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
virHashFree(meminfo);
return -1;
}
/* if qemu doesn't support the info request, just carry on */
if (rc == -2)