Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1f45b30975..3dfc79f61e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8198,7 +8198,7 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
int asyncJob)
{
qemuDomainObjPrivate *priv = vm->privateData;
- GHashTable *meminfo = NULL;
+ g_autoptr(GHashTable) meminfo = NULL;
int rc;
size_t i;
@@ -8210,10 +8210,8 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
- if (qemuDomainObjExitMonitor(driver, vm) < 0) {
- virHashFree(meminfo);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
return -1;
- }
if (rc < 0)
return -1;
@@ -8247,7 +8245,6 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
}
}
- virHashFree(meminfo);
return 0;
}
--
2.31.1