diff options
author | Thomas Haller <thaller@redhat.com> | 2013-11-22 18:28:11 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2013-11-22 18:47:50 +0100 |
commit | 2904a99de079ddc481c65cf5dea8ab3cad5d8369 (patch) | |
tree | e658c396061f58cc46e731aa6ddee96b090d792d | |
parent | 21385d31fb547377d63236af4ec321d72866463c (diff) | |
download | NetworkManager-2904a99de079ddc481c65cf5dea8ab3cad5d8369.tar.gz |
fixup! core: fix crash in nm-manager-auth
-rw-r--r-- | src/nm-manager-auth.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c index 12f2c5f224..7dc25b8929 100644 --- a/src/nm-manager-auth.c +++ b/src/nm-manager-auth.c @@ -382,13 +382,16 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) g_assert (call->call_idle_id == 0); + pk_result = polkit_authority_check_authorization_finish ((PolkitAuthority *) object, result, &error); + /* If the call is already canceled do nothing */ if (!call->cancellable) { + g_clear_error (&error); + g_clear_object (&pk_result); auth_call_free (call); return; } - pk_result = polkit_authority_check_authorization_finish (chain->authority, result, &error); if (error) { if (!chain->error) chain->error = g_error_copy (error); @@ -397,6 +400,7 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) call->permission, error ? error->code : -1, error && error->message ? error->message : "(unknown)"); + g_clear_error (&error); } else { guint call_result = NM_AUTH_CALL_RESULT_UNKNOWN; @@ -412,7 +416,6 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data) nm_auth_chain_set_data (chain, call->permission, GUINT_TO_POINTER (call_result), NULL); } - g_clear_error (&error); if (pk_result) g_object_unref (pk_result); |