From aa4a0264bfba44d68b2f997cf347302038ce6f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 19 Dec 2019 09:33:54 +0100 Subject: [PATCH] util: Don't check the output of virGetUserConfigDirectory() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virGetUserConfigDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio Reviewed-by: Ján Tomko --- 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 db2bbb7e37..f79024f07a 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 { g_autofree char *userdir = virGetUserConfigDirectory(); - if (!userdir) - return NULL; path = g_strdup_printf("%s/%s", userdir, name); }