mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
remote: Use g_autofree in daemonConfigFilePath()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
964482aec2
commit
4dc0a51bac
@ -79,19 +79,15 @@ daemonConfigFilePath(bool privileged, char **configfile)
|
||||
if (privileged) {
|
||||
*configfile = g_strdup(SYSCONFDIR "/libvirt/" DAEMON_NAME ".conf");
|
||||
} else {
|
||||
char *configdir = NULL;
|
||||
g_autofree char *configdir = NULL;
|
||||
|
||||
if (!(configdir = virGetUserConfigDirectory()))
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
*configfile = g_strdup_printf("%s/%s.conf", configdir, DAEMON_NAME);
|
||||
VIR_FREE(configdir);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct daemonConfig*
|
||||
|
Loading…
x
Reference in New Issue
Block a user