]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Finish freeing the client when anvil lookup is pending at destroy
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 16 Mar 2021 12:37:54 +0000 (14:37 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 16 Mar 2021 12:37:54 +0000 (14:37 +0200)
Broken by f32daf5ac9eaa886e28659965fc0156b52b60bda

src/login-common/client-common.c
src/login-common/sasl-server.c

index e358e1a61b756ef6cff8b62216f612abf79af4d6..69477a96c3fb41e06420b64781d9775c19e610df 100644 (file)
@@ -323,14 +323,14 @@ void client_destroy(struct client *client, const char *reason)
                client->authenticating = FALSE;
                master_auth_request_abort(master_auth, client->master_tag);
                client->refcount--;
-       } else if (client->auth_request != NULL) {
+       } else if (client->auth_request != NULL ||
+                  client->anvil_query != NULL) {
                i_assert(client->authenticating);
                sasl_server_auth_abort(client);
-       } else if (client->anvil_query != NULL) {
-               anvil_client_query_abort(anvil, &client->anvil_query);
-       } else {
-               i_assert(!client->authenticating);
        }
+       i_assert(!client->authenticating);
+       i_assert(client->auth_request == NULL);
+       i_assert(client->anvil_query == NULL);
 
        timeout_remove(&client->to_disconnect);
        timeout_remove(&client->to_auth_waiting);
index e4a585c513a69e85fb0d62edfda6172e58fb01d2..b550d629af569d2078fee8f2068c2a27fff0aa68 100644 (file)
@@ -552,5 +552,7 @@ void sasl_server_auth_failed(struct client *client, const char *reason,
 void sasl_server_auth_abort(struct client *client)
 {
        client->auth_try_aborted = TRUE;
+       if (client->anvil_query != NULL)
+               anvil_client_query_abort(anvil, &client->anvil_query);
        sasl_server_auth_cancel(client, NULL, NULL, SASL_SERVER_REPLY_AUTH_ABORTED);
 }