From: Tim Wiederhake Date: Mon, 5 Jul 2021 14:33:56 +0000 (+0200) Subject: testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management X-Git-Tag: v7.6.0-rc1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cca44e5298e9fcf1b6265c5f90e8c66bbd4de877;p=thirdparty%2Flibvirt.git testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: Use automatic memory management Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- 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; }