mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8e71e5b10e
commit
d9074b8e01
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user