]> 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)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 7 Mar 2017 08:38:45 +0000 (10:38 +0200)
Callback might be called twice.

src/auth/db-oauth2.c

index 3c14d79d229208a3bacb080ed57c21fbc358fc7d..95ba5a8e8d6f8bb80922d9b28240d69a356ed1eb 100644 (file)
@@ -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