tests: use g_autoptr instead of virObjectUnref

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Ján Tomko
2021-08-20 15:53:53 +02:00
parent a26df27662
commit d66fb7ac15
12 changed files with 24 additions and 48 deletions

View File

@@ -30,7 +30,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
int ret;
testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS;
virNetworkDef *dev = NULL;
virNetworkXMLOption *xmlopt = NULL;
g_autoptr(virNetworkXMLOption) xmlopt = NULL;
if (!(xmlopt = networkDnsmasqCreateXMLConf()))
goto cleanup;
@@ -72,7 +72,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml,
VIR_FREE(actual);
virNetworkDefFree(dev);
virObjectUnref(xmlopt);
return ret;
}