From cca44e5298e9fcf1b6265c5f90e8c66bbd4de877 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 5 Jul 2021 16:33:56 +0200 Subject: [PATCH] testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/qemumonitorjsontest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 8895c7305f..e4a907e5b6 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -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; }