mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +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) {
|
||||
path = g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name);
|
||||
} else {
|
||||
char *userdir = virGetUserConfigDirectory();
|
||||
g_autofree char *userdir = virGetUserConfigDirectory();
|
||||
if (!userdir)
|
||||
return NULL;
|
||||
|
||||
path = g_strdup_printf("%s/%s", userdir, name);
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
|
||||
return path;
|
||||
|
Loading…
Reference in New Issue
Block a user