virGetUserConfigDirectory() *never* *ever* returns NULL, making the
checks for it completely unnecessary.
Signed-off-by: Fabiano FidĂȘncio <fidencio(a)redhat.com>
---
src/util/virauth.c | 3 +--
src/util/virconf.c | 2 --
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/util/virauth.c b/src/util/virauth.c
index 55208c01ef..f75e674586 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -66,8 +66,7 @@ virAuthGetConfigFilePathURI(virURIPtr uri,
}
}
- if (!(userdir = virGetUserConfigDirectory()))
- return -1;
+ userdir = virGetUserConfigDirectory();
*path = g_strdup_printf("%s/auth.conf", userdir);
diff --git a/src/util/virconf.c b/src/util/virconf.c
index dce84cabb7..cd18ea61e6 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -1507,8 +1507,6 @@ virConfLoadConfigPath(const char *name)
path = g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name);
} else {
char *userdir = virGetUserConfigDirectory();
- if (!userdir)
- return NULL;
path = g_strdup_printf("%s/%s", userdir, name);
VIR_FREE(userdir);
--
2.24.1