mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
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:
parent
b76b6a6169
commit
c97b632283
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user