]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Avoid crashing when finishing failed requests that already timed out.
authorTimo Sirainen <tss@iki.fi>
Thu, 30 Sep 2010 16:12:55 +0000 (17:12 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 30 Sep 2010 16:12:55 +0000 (17:12 +0100)
src/auth/auth-request-handler.c
src/auth/auth-request.h

index a8206f9a955faf2a44f3169b6a8ff4179ef21c3a..c3d5cb0b7ca61d24d8b448df951933b9d5c769a7 100644 (file)
@@ -116,6 +116,12 @@ static void auth_request_handler_remove(struct auth_request_handler *handler,
 {
        i_assert(request->handler == handler);
 
+       if (request->removed_from_handler) {
+               /* already removed it */
+               return;
+       }
+       request->removed_from_handler = TRUE;
+
        /* if db lookup is stuck, this call doesn't actually free the auth
           request, so make sure we don't get back here. */
        timeout_remove(&request->to_abort);
index 3e7bc47285f81402430c0a44923e981dc8276ede..eeadb799c1693a70bc28049ee02eaa081915cda5 100644 (file)
@@ -109,6 +109,7 @@ struct auth_request {
        unsigned int userdb_lookup:1;
        unsigned int userdb_lookup_failed:1;
        unsigned int secured:1;
+       unsigned int removed_from_handler:1;
 
        /* ... mechanism specific data ... */
 };