summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-11-22 19:49:25 +0100
committerThomas Haller <thaller@redhat.com>2013-11-22 19:49:25 +0100
commitad4f59284402289f4857f5d20e388c4bfa7e95a5 (patch)
treeaf14954a551d09fca53cf288ab4ea3ba8ec41f93
parentd87a3b6627867c9bd5108f356a78fba426e493c1 (diff)
downloadNetworkManager-th/crash_auth.tar.gz
fixup! core: fix crash in nm-manager-authth/crash_auth
-rw-r--r--src/nm-manager-auth.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nm-manager-auth.c b/src/nm-manager-auth.c
index 0c3c8fb4a5..dfe4c6168c 100644
--- a/src/nm-manager-auth.c
+++ b/src/nm-manager-auth.c
@@ -333,6 +333,7 @@ static void
auth_call_free (AuthCall *call)
{
g_free (call->permission);
+ g_clear_object (&call->cancellable);
g_free (call);
}
@@ -380,16 +381,13 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data)
auth_call_free (call);
return;
}
- g_object_unref (call->cancellable);
if (error) {
if (!call->chain->error)
call->chain->error = g_error_copy (error);
nm_log_warn (LOGD_CORE, "error requesting auth for %s: (%d) %s",
- call->permission,
- error ? error->code : -1,
- error && error->message ? error->message : "(unknown)");
+ call->permission, error->code, error->message);
g_clear_error (&error);
} else {
guint call_result = NM_AUTH_CALL_RESULT_UNKNOWN;
@@ -404,10 +402,8 @@ pk_call_cb (GObject *object, GAsyncResult *result, gpointer user_data)
call_result = NM_AUTH_CALL_RESULT_NO;
nm_auth_chain_set_data (call->chain, call->permission, GUINT_TO_POINTER (call_result), NULL);
- }
-
- if (pk_result)
g_object_unref (pk_result);
+ }
auth_call_complete (call);
}