Use g_auto where possible and remove the pointless label.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
static int
testCompareXMLToXMLFiles(const char *inxml, const char *outxml)
{
- char *actual = NULL;
- int ret = -1;
- virSecretDef *secret = NULL;
+ g_autofree char *actual = NULL;
+ g_autoptr(virSecretDef) secret = NULL;
if (!(secret = virSecretDefParseFile(inxml)))
- goto fail;
+ return -1;
if (!(actual = virSecretDefFormat(secret)))
- goto fail;
+ return -1;
if (virTestCompareToFile(actual, outxml) < 0)
- goto fail;
+ return -1;
- ret = 0;
-
- fail:
- VIR_FREE(actual);
- virSecretDefFree(secret);
- return ret;
+ return 0;
}
struct testInfo {