From c97b632283ff693b80b7deda3e8f526f1f115dca Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 23 Jan 2023 16:36:43 +0100 Subject: [PATCH] util: authconfig: Don't check return value of 'g_key_file_new()' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The function can't fail so it's pointless to check its return value. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/util/virauthconfig.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 0363a1bef9..818df7a252 100644 --- a/src/util/virauthconfig.c +++ b/src/util/virauthconfig.c @@ -41,9 +41,7 @@ virAuthConfigNew(const char *path) g_autoptr(virAuthConfig) auth = g_new0(virAuthConfig, 1); auth->path = g_strdup(path); - - if (!(auth->keyfile = g_key_file_new())) - return NULL; + auth->keyfile = g_key_file_new(); if (!g_key_file_load_from_file(auth->keyfile, path, 0, NULL)) return NULL; @@ -60,9 +58,7 @@ virAuthConfigNewData(const char *path, g_autoptr(virAuthConfig) auth = g_new0(virAuthConfig, 1); auth->path = g_strdup(path); - - if (!(auth->keyfile = g_key_file_new())) - return NULL; + auth->keyfile = g_key_file_new(); if (!g_key_file_load_from_data(auth->keyfile, data, len, 0, NULL)) return NULL; -- 2.47.2