[PATCH 1/5] util: authconfig: Don't check return value of 'g_key_file_new()'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function can't fail so it's pointless to check its return value.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 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.38.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux