From ec1dc3134961d9626cf1402a8403ce5067dc64b0 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 27 Nov 2013 10:59:19 +0200 Subject: [PATCH] core: Fix checking for removed authorization in agent_auth_cb --- src/adapter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index d904a5630..120a77f5d 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -4350,9 +4350,12 @@ static void agent_auth_cb(struct agent *agent, DBusError *derr, void *user_data) { struct btd_adapter *adapter = user_data; - struct service_auth *auth = adapter->auths->head->data; + struct service_auth *auth = g_queue_pop_head(adapter->auths); - g_queue_pop_head(adapter->auths); + if (!auth) { + DBG("No pending authorization"); + return; + } auth->cb(derr, auth->user_data); -- 2.47.3