]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorGetMemoryDeviceInfo: Use automatic memory management
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 14:02:40 +0000 (16:02 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Wed, 14 Jul 2021 13:36:41 +0000 (15:36 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_monitor.c

index 9b1a3ec3eb72f4279948834db930266021008aa4..0b5da8b71fd84c8aa718b2282c974aba5628644b 100644 (file)
@@ -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;
 }