]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
authorLaine Stump <laine@redhat.com>
Thu, 18 Aug 2022 17:26:34 +0000 (13:26 -0400)
committerLaine Stump <laine@redhat.com>
Wed, 24 Aug 2022 16:22:47 +0000 (12:22 -0400)
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/networkxml2firewalltest.c
tests/networkxml2xmltest.c
tests/networkxml2xmlupdatetest.c

index 2648115a1224bb2d3b5fe18b52f7e527de7b2478..f895ca8c56726d00ee4baeff260f3e241f0383af 100644 (file)
@@ -89,7 +89,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
 {
     g_autofree char *actualargv = NULL;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
-    virNetworkDef *def = NULL;
+    g_autoptr(virNetworkDef) def = NULL;
     int ret = -1;
     char *actual;
     g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew();
@@ -117,7 +117,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
     ret = 0;
 
  cleanup:
-    virNetworkDefFree(def);
     return ret;
 }
 
index 5f39162ef15e81ce8cd2e3b160191c393549d0da..521f058acc194bfad3d9544ea48adc1acf09d1c0 100644 (file)
@@ -27,7 +27,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
     g_autofree char *actual = NULL;
     int ret;
     testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS;
-    virNetworkDef *dev = NULL;
+    g_autoptr(virNetworkDef) dev = NULL;
     g_autoptr(virNetworkXMLOption) xmlopt = NULL;
 
     if (!(xmlopt = networkDnsmasqCreateXMLConf()))
@@ -68,7 +68,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
     }
     virResetLastError();
 
-    virNetworkDefFree(dev);
     return ret;
 }
 
index c50c6c85585de54e9703fe63d988cb693e69461a..4926609f907a65b6c45f2e8fa1546672b46634e9 100644 (file)
@@ -20,7 +20,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
     g_autofree char *updateXmlData = NULL;
     g_autofree char *actual = NULL;
     int ret = -1;
-    virNetworkDef *def = NULL;
+    g_autoptr(virNetworkDef) def = NULL;
 
     if (virTestLoadFile(updatexml, &updateXmlData) < 0)
         goto error;
@@ -53,7 +53,6 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml,
         }
     }
  error:
-    virNetworkDefFree(def);
     return ret;
 }