]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
db-oauth2: Make sure request is removed only once
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 7 Mar 2017 08:09:20 +0000 (10:09 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 16 Mar 2017 17:40:59 +0000 (19:40 +0200)
Callback might be called twice.

src/auth/db-oauth2.c

index af0070188dfdec76f5adeddb418368348096d7d2..4c4c4b589f37f9d8aa6079bb45f894d580e71914 100644 (file)
@@ -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