[libvirt PATCH v2 09/10] qemuMonitorGetMemoryDeviceInfo: Use automatic memory management

Tim Wiederhake twiederh at redhat.com
Tue Jul 13 15:12:11 UTC 2021


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/qemu/qemu_monitor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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;
 }
 
-- 
2.31.1




More information about the libvir-list mailing list