]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: use g_auto for virCPUDataFree
authorJán Tomko <jtomko@redhat.com>
Fri, 3 Sep 2021 20:59:14 +0000 (22:59 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 9 Sep 2021 16:06:13 +0000 (18:06 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
tests/qemumonitorjsontest.c

index 542b35850e2bef13e896fd431d63ca6e1007ddd7..b68351d9d8439946ad3d42634fd08bfb2ccae0ee 100644 (file)
@@ -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;
 }