tests: use g_autofree

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-09-04 22:37:44 +02:00
parent 526551ac0a
commit 296f7173ed
21 changed files with 71 additions and 146 deletions

View File

@@ -16,8 +16,8 @@
static int
testCompareXMLToXMLFiles(const char *xml, const char *outfile)
{
char *xmlData = NULL;
char *actual = NULL;
g_autofree char *xmlData = NULL;
g_autofree char *actual = NULL;
int ret = -1;
virNodeDeviceDef *dev = NULL;
virNodeDevCapsDef *caps;
@@ -59,8 +59,6 @@ testCompareXMLToXMLFiles(const char *xml, const char *outfile)
ret = 0;
fail:
VIR_FREE(xmlData);
VIR_FREE(actual);
virNodeDeviceDefFree(dev);
return ret;
}
@@ -69,7 +67,7 @@ static int
testCompareXMLToXMLHelper(const void *data)
{
int result = -1;
char *xml = NULL;
g_autofree char *xml = NULL;
g_autofree char *outfile = NULL;
xml = g_strdup_printf("%s/nodedevschemadata/%s.xml", abs_srcdir,
@@ -80,7 +78,6 @@ testCompareXMLToXMLHelper(const void *data)
result = testCompareXMLToXMLFiles(xml, outfile);
VIR_FREE(xml);
return result;
}