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

index 940eeab9a85e3b7566d0a3a4f5631f3868aed265..36b1f15c7d9e7938b631af73180e5604d700e4f9 100644 (file)
@@ -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;
 }