mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
logging: Use g_autofree in virLogDaemonConfigFilePath()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
70c2052011
commit
ce33c21f23
@ -42,13 +42,12 @@ virLogDaemonConfigFilePath(bool privileged, char **configfile)
|
|||||||
if (privileged) {
|
if (privileged) {
|
||||||
*configfile = g_strdup(SYSCONFDIR "/libvirt/virtlogd.conf");
|
*configfile = g_strdup(SYSCONFDIR "/libvirt/virtlogd.conf");
|
||||||
} else {
|
} else {
|
||||||
char *configdir = NULL;
|
g_autofree char *configdir = NULL;
|
||||||
|
|
||||||
if (!(configdir = virGetUserConfigDirectory()))
|
if (!(configdir = virGetUserConfigDirectory()))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
*configfile = g_strdup_printf("%s/virtlogd.conf", configdir);
|
*configfile = g_strdup_printf("%s/virtlogd.conf", configdir);
|
||||||
VIR_FREE(configdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user