dnsmasqAddnHost *hosts,
unsigned int nhosts)
{
- char *tmp;
+ g_autofree char *tmp = NULL;
FILE *f;
bool istmp = true;
size_t i, j;
}
cleanup:
- VIR_FREE(tmp);
-
return rc;
}
dnsmasqDhcpHost *hosts,
unsigned int nhosts)
{
- char *tmp;
+ g_autofree char *tmp = NULL;
FILE *f;
bool istmp = true;
size_t i;
}
cleanup:
- VIR_FREE(tmp);
-
return rc;
}
dnsmasqCapsSetFromFile(dnsmasqCapsPtr caps, const char *path)
{
int ret = -1;
- char *buf = NULL;
+ g_autofree char *buf = NULL;
if (virFileReadAll(path, 1024 * 1024, &buf) < 0)
goto cleanup;
ret = dnsmasqCapsSetFromBuffer(caps, buf);
cleanup:
- VIR_FREE(buf);
return ret;
}
int ret = -1;
struct stat sb;
virCommandPtr cmd = NULL;
- char *help = NULL, *version = NULL, *complete = NULL;
+ g_autofree char *help = NULL;
+ g_autofree char *version = NULL;
+ g_autofree char *complete = NULL;
if (!caps || caps->noRefresh)
return 0;
cleanup:
virCommandFree(cmd);
- VIR_FREE(help);
- VIR_FREE(version);
- VIR_FREE(complete);
return ret;
}