summaryrefslogtreecommitdiff
path: root/src/nm-manager-auth.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-11-22 19:14:03 +0100
committerThomas Haller <thaller@redhat.com>2013-11-22 19:14:03 +0100
commit7d86d213698900ea75792e7ceb9feacf00249457 (patch)
tree0448721ac52844e12a4998c9766777f65d232860 /src/nm-manager-auth.c
parent2904a99de079ddc481c65cf5dea8ab3cad5d8369 (diff)
downloadNetworkManager-7d86d213698900ea75792e7ceb9feacf00249457.tar.gz
fixup! core: fix crash in nm-manager-auth
Diffstat (limited to 'src/nm-manager-auth.c')
-rw-r--r--src/nm-manager-auth.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c
index 7dc25b8929..ef92df2bb9 100644
--- a/src/nm-manager-auth.c
+++ b/src/nm-manager-auth.c
@@ -336,8 +336,6 @@ auth_call_free (AuthCall *call)
g_free (call->permission);
g_clear_object (&call->cancellable);
- if (call->call_idle_id)
- g_source_remove (call->call_idle_id);
memset (call, 0, sizeof (*call));
g_free (call);
}
@@ -346,13 +344,6 @@ auth_call_free (AuthCall *call)
static gboolean
auth_call_complete (AuthCall *call)
{
- g_return_val_if_fail (call != NULL, FALSE);
- g_assert ((call->call_idle_id != 0) ^ (call->cancellable != NULL));
-
- /* If called from g_idle_add, we don't have to g_source_remove. If called from
- * pk_call_cb, we were never scheduled with g_idle_add. So, set call_idle_id
- * to zero. */
- call->call_idle_id = 0;
nm_auth_chain_remove_call (call->chain, call);
nm_auth_chain_check_done (call->chain);
auth_call_free (call);
@@ -362,13 +353,13 @@ auth_call_complete (AuthCall *call)
static void
auth_call_cancel (AuthCall *call)
{
- g_assert ((call->call_idle_id != 0) ^ (call->cancellable != NULL));
-
if (call->cancellable) {
g_cancellable_cancel (call->cancellable);
g_clear_object (&call->cancellable);
- } else
+ } else {
+ g_source_remove (call->call_idle_id);
auth_call_free (call);
+ }
}
#if WITH_POLKIT
@@ -380,8 +371,6 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data)
PolkitAuthorizationResult *pk_result;
GError *error = NULL;
- 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 */