mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
util: Use g_autofree in virConfLoadConfigPath()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d0e1c6a6ae
commit
09ae41b88c
@ -1506,12 +1506,11 @@ virConfLoadConfigPath(const char *name)
|
|||||||
if (geteuid() == 0) {
|
if (geteuid() == 0) {
|
||||||
path = g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name);
|
path = g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name);
|
||||||
} else {
|
} else {
|
||||||
char *userdir = virGetUserConfigDirectory();
|
g_autofree char *userdir = virGetUserConfigDirectory();
|
||||||
if (!userdir)
|
if (!userdir)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
path = g_strdup_printf("%s/%s", userdir, name);
|
path = g_strdup_printf("%s/%s", userdir, name);
|
||||||
VIR_FREE(userdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
|
Loading…
Reference in New Issue
Block a user