changeset 21728:fb3278b43cdd

auth: oauth2 - Fix aborting auth requests on deinit. The auth_request needs to be finished by calling the callback.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 16 Mar 2017 00:13:08 +0200
parents d480d29e6dc1
children dfcfdbbe1fd1
files src/auth/db-oauth2.c
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/db-oauth2.c	Mon Mar 06 14:59:46 2017 +0200
+++ b/src/auth/db-oauth2.c	Thu Mar 16 00:13:08 2017 +0200
@@ -256,13 +256,8 @@
 	i_assert(ptr != NULL && ptr == db);
 
 	/* make sure all requests are aborted */
-	struct db_oauth2_request *req = db->head;
-	db->head = NULL;
-
-	for(; req != NULL; req = req->next) {
-		req->callback = NULL;
-		oauth2_request_abort(&req->req);
-	}
+	while (db->head != NULL)
+		oauth2_request_abort(&db->head->req);
 
 	http_client_deinit(&db->client);