char *outhostsfile, dnsmasqCaps *caps)
{
char *confactual = NULL;
- char *hostsfileactual = NULL;
+ g_autofree char *hostsfileactual = NULL;
int ret = -1;
virNetworkDef *def = NULL;
virNetworkObj *obj = NULL;
virCommand *cmd = NULL;
- char *pidfile = NULL;
+ g_autofree char *pidfile = NULL;
dnsmasqContext *dctx = NULL;
g_autoptr(virNetworkXMLOption) xmlopt = NULL;
fail:
VIR_FREE(confactual);
- VIR_FREE(hostsfileactual);
- VIR_FREE(pidfile);
virCommandFree(cmd);
virNetworkObjEndAPI(&obj);
dnsmasqContextFree(dctx);
{
int result = -1;
const testInfo *info = data;
- char *inxml = NULL;
- char *outconf = NULL;
- char *outhostsfile = NULL;
+ g_autofree char *inxml = NULL;
+ g_autofree char *outconf = NULL;
+ g_autofree char *outhostsfile = NULL;
inxml = g_strdup_printf("%s/networkxml2confdata/%s.xml", abs_srcdir, info->name);
outconf = g_strdup_printf("%s/networkxml2confdata/%s.conf", abs_srcdir, info->name);
result = testCompareXMLToConfFiles(inxml, outconf, outhostsfile, info->caps);
- VIR_FREE(inxml);
- VIR_FREE(outconf);
- VIR_FREE(outhostsfile);
-
return result;
}
const char *cmdline,
const char *baseargs)
{
- char *actualargv = NULL;
+ g_autofree char *actualargv = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virNetworkDef *def = NULL;
int ret = -1;
ret = 0;
cleanup:
- VIR_FREE(actualargv);
virNetworkDefFree(def);
return ret;
}
{
int result = -1;
const struct testInfo *info = data;
- char *xml = NULL;
- char *args = NULL;
+ g_autofree char *xml = NULL;
+ g_autofree char *args = NULL;
xml = g_strdup_printf("%s/networkxml2firewalldata/%s.xml",
abs_srcdir, info->name);
result = testCompareXMLToArgvFiles(xml, args, info->baseargs);
- VIR_FREE(xml);
- VIR_FREE(args);
return result;
}
unsigned int flags,
testCompareNetXML2XMLResult expectResult)
{
- char *actual = NULL;
+ g_autofree char *actual = NULL;
int ret;
testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS;
virNetworkDef *dev = NULL;
}
virResetLastError();
- VIR_FREE(actual);
virNetworkDefFree(dev);
return ret;
}
{
const struct testInfo *info = data;
int result = -1;
- char *inxml = NULL;
- char *outxml = NULL;
+ g_autofree char *inxml = NULL;
+ g_autofree char *outxml = NULL;
inxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml", abs_srcdir, info->name);
outxml = g_strdup_printf("%s/networkxml2xmlout/%s.xml", abs_srcdir, info->name);
result = testCompareXMLToXMLFiles(inxml, outxml, info->flags,
info->expectResult);
- VIR_FREE(inxml);
- VIR_FREE(outxml);
-
return result;
}
unsigned int command, unsigned int section,
int parentIndex, bool expectFailure)
{
- char *updateXmlData = NULL;
- char *actual = NULL;
+ g_autofree char *updateXmlData = NULL;
+ g_autofree char *actual = NULL;
int ret = -1;
virNetworkDef *def = NULL;
}
}
error:
- VIR_FREE(updateXmlData);
- VIR_FREE(actual);
virNetworkDefFree(def);
return ret;
}
{
const struct testInfo *info = data;
int result = -1;
- char *netxml = NULL;
- char *updatexml = NULL;
- char *outxml = NULL;
+ g_autofree char *netxml = NULL;
+ g_autofree char *updatexml = NULL;
+ g_autofree char *outxml = NULL;
netxml = g_strdup_printf("%s/networkxml2xmlin/%s.xml",
abs_srcdir, info->netxml);
info->command, info->section,
info->parentIndex, info->expectFailure);
- VIR_FREE(netxml);
- VIR_FREE(updatexml);
- VIR_FREE(outxml);
-
return result;
}