From: Tim Wiederhake Date: Mon, 5 Jul 2021 14:02:40 +0000 (+0200) Subject: qemuMonitorGetMemoryDeviceInfo: Use automatic memory management X-Git-Tag: v7.6.0-rc1~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ed26fca816816a0b5f3c8163dea4c47aa04c2e2;p=thirdparty%2Flibvirt.git qemuMonitorGetMemoryDeviceInfo: Use automatic memory management Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9b1a3ec3eb..0b5da8b71f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,7 +4214,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { - GHashTable *hash; + g_autoptr(GHashTable) hash = NULL; int ret; VIR_DEBUG("info=%p", info); @@ -4229,7 +4229,6 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, if ((ret = qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >= 0) *info = g_steal_pointer(&hash); - virHashFree(hash); return ret; }