testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Use automatic memory management

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-07-05 16:48:02 +02:00
parent 091f22223b
commit 831568e831

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