util: authconfig: Don't check return value of 'g_key_file_new()'

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-01-23 16:36:43 +01:00
parent b76b6a6169
commit c97b632283

View File

@ -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;