Diff between bb712ac7913c2e0df538abe31123c3f113c54c5d and ec1dc3134961d9626cf1402a8403ce5067dc64b0

Changed Files

File Additions Deletions Status
src/adapter.c +5 -2 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index d904a56..120a77f 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);