bool compareFailed = false;
if (!(obj = virNetworkObjNew()))
- goto fail;
+ goto cleanup;
if (!(def = g_steal_pointer(&info->def))) {
/* Previous test wasn't executed. */
if (!(def = virNetworkDefParse(NULL, info->inxml, info->xmlopt, false)))
- goto fail;
+ goto cleanup;
if (networkValidateTests(def) < 0) {
virNetworkDefFree(def);
- goto fail;
+ goto cleanup;
}
}
if (!networkNeedsDnsmasq(def)) {
ret = EXIT_AM_SKIP;
- goto fail;
+ goto cleanup;
}
dctx = dnsmasqContextNew(def->name, "/var/lib/libvirt/dnsmasq");
if (dctx == NULL)
- goto fail;
+ goto cleanup;
if (networkDnsmasqConfContents(obj, pidfile, &confactual,
&hostsfileactual, dctx, info->caps) < 0)
- goto fail;
+ goto cleanup;
/* Any changes to this function ^^ should be reflected here too. */
#ifndef __linux__
if (!(tmp = virStringReplace(confactual,
"except-interface=lo0\n",
"except-interface=lo\n")))
- goto fail;
+ goto cleanup;
VIR_FREE(confactual);
confactual = g_steal_pointer(&tmp);
}
}
if (compareFailed)
- goto fail;
+ goto cleanup;
ret = 0;
- fail:
+ cleanup:
VIR_FREE(confactual);
virNetworkObjEndAPI(&obj);
return ret;