From 0047bb18bc88955bc4151edd917cec4160e7b653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 3 Sep 2021 22:59:14 +0200 Subject: [PATCH] tests: use g_auto for virCPUDataFree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ján Tomko Reviewed-by: Laine Stump --- tests/qemumonitorjsontest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 542b35850e..b68351d9d8 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2158,7 +2158,7 @@ static int testQemuMonitorJSONGetCPUData(const void *opaque) { const struct testCPUData *data = opaque; - virCPUData *cpuData = NULL; + g_autoptr(virCPUData) cpuData = NULL; g_autofree char *jsonFile = NULL; g_autofree char *dataFile = NULL; g_autofree char *jsonStr = NULL; @@ -2208,7 +2208,6 @@ testQemuMonitorJSONGetCPUData(const void *opaque) ret = 0; cleanup: - virCPUDataFree(cpuData); return ret; } @@ -2217,7 +2216,7 @@ testQemuMonitorJSONGetNonExistingCPUData(const void *opaque) { const testGenericData *data = opaque; virDomainXMLOption *xmlopt = data->xmlopt; - virCPUData *cpuData = NULL; + g_autoptr(virCPUData) cpuData = NULL; int rv, ret = -1; g_autoptr(qemuMonitorTest) test = NULL; @@ -2251,7 +2250,6 @@ testQemuMonitorJSONGetNonExistingCPUData(const void *opaque) ret = 0; cleanup: - virCPUDataFree(cpuData); return ret; }