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.3.0.rc1~1966 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3871fbbab95e41424a29d6f1cbfedc198b00079d;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 3c14d79d22..95ba5a8e8d 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -420,10 +420,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