提交 c679e8a4 编写于 作者: Y Yi Wang 提交者: Michal Privoznik

qemu: Fix memory leak in qemuDomainUpdateMemoryDeviceInfo

The @meminfo allocated in qemuMonitorGetMemoryDeviceInfo() may be
lost when qemuDomainObjExitMonitor() failed.
Signed-off-by: NYi Wang <wang.yi59@zte.com.cn>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 2c8e30ee
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册