]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Use automatic memory management
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 14:48:02 +0000 (16:48 +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 89ede3b59a16ff66276f3f478482fbf6955ec571..89ace3bb331c537ae4aafd78ac768e5728a4e140 100644 (file)
@@ -1812,8 +1812,8 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
     const testGenericData *data = opaque;
     virDomainXMLOption *xmlopt = data->xmlopt;
     int ret = -1;
-    GHashTable *info = NULL;
-    GHashTable *expectedInfo = NULL;
+    g_autoptr(GHashTable) info = NULL;
+    g_autoptr(GHashTable) expectedInfo = NULL;
     qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
     qemuMonitorChardevInfo info1 = { (char *) "/dev/pts/21", VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED };
     qemuMonitorChardevInfo info2 = { (char *) "/dev/pts/20", VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
@@ -1874,8 +1874,6 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
 
     ret = 0;
  cleanup:
-    virHashFree(info);
-    virHashFree(expectedInfo);
     return ret;
 }