From: Aki Tuomi Date: Tue, 7 Mar 2017 08:09:20 +0000 (+0200) Subject: db-oauth2: Make sure request is removed only once X-Git-Tag: 2.2.29.rc1~191 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9e9cfac848db4b67fdb711e61f4cfb4d1dfd266;p=thirdparty%2Fdovecot%2Fcore.git db-oauth2: Make sure request is removed only once Callback might be called twice. --- diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index af0070188d..4c4c4b589f 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -408,10 +408,10 @@ static void db_oauth2_callback(struct db_oauth2_request *req, bool success, i_assert(req->result == PASSDB_RESULT_OK || (!success && error != NULL)); - if (callback != NULL) + if (callback != NULL) { + DLLIST_REMOVE(&req->db->head, req); callback(req->db, success, req, error, req->context); - - DLLIST_REMOVE(&req->db->head, req); + } } static bool