]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 14:33:56 +0000 (16:33 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Wed, 14 Jul 2021 13:37:07 +0000 (15:37 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsontest.c

index 8895c7305fb3379ce3aaabe086ca16d120eca100..e4a907e5b63bcddb66c41d5f0e422ecff6f83617 100644 (file)
@@ -1461,8 +1461,8 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
     const testGenericData *data = opaque;
     virDomainXMLOption *xmlopt = data->xmlopt;
     int ret = -1;
-    GHashTable *blockDevices = NULL;
-    GHashTable *expectedBlockDevices = NULL;
+    g_autoptr(GHashTable) blockDevices = NULL;
+    g_autoptr(GHashTable) expectedBlockDevices = NULL;
     struct qemuDomainDiskInfo *info;
     g_autoptr(qemuMonitorTest) test = NULL;
 
@@ -1526,8 +1526,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
 
     ret = 0;
  cleanup:
-    virHashFree(blockDevices);
-    virHashFree(expectedBlockDevices);
     return ret;
 }