提交 09ae41b8 编写于 作者: F Fabiano Fidêncio

util: Use g_autofree in virConfLoadConfigPath()

Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 d0e1c6a6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册