[libvirt PATCH 03/10] qemuMonitorGetPRManagerInfo: Use automatic memory management

Tim Wiederhake twiederh at redhat.com
Mon Jul 19 09:55:47 UTC 2021


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

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 940eeab9a8..36b1f15c7d 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4516,21 +4516,18 @@ qemuMonitorGetPRManagerInfo(qemuMonitor *mon,
                             GHashTable **retinfo)
 {
     int ret = -1;
-    GHashTable *info = NULL;
+    g_autoptr(GHashTable) info = virHashNew(g_free);
 
     *retinfo = NULL;
 
     QEMU_CHECK_MONITOR(mon);
 
-    info = virHashNew(g_free);
-
     if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0)
         goto cleanup;
 
     *retinfo = g_steal_pointer(&info);
     ret = 0;
  cleanup:
-    virHashFree(info);
     return ret;
 }
 
-- 
2.31.1




More information about the libvir-list mailing list