]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: imapc_connection_disconnect_full() - Only conditionally abort
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 3 Mar 2022 13:21:00 +0000 (14:21 +0100)
committerMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Tue, 25 Oct 2022 05:49:01 +0000 (08:49 +0300)
Only abort commands if there are no reconnect commands. Otherwise these
still will be handled and the commands memory will be freed after handling
them.

Broken by 6d16e82fa2c352974558e1415d06f07d8962fe09

src/lib-imap-client/imapc-connection.c

index f8ae0ca5f6f151a30ee16433bbbdd2eaa58c34b5..8527817434dbacf3cb2cd2e6ef5d2db49500312d 100644 (file)
@@ -446,7 +446,9 @@ void imapc_connection_disconnect_full(struct imapc_connection *conn,
 
        if (conn->state == IMAPC_CONNECTION_STATE_DISCONNECTED) {
                i_assert(array_count(&conn->cmd_wait_list) == 0);
-               imapc_connection_abort_commands(conn, NULL, reconnecting);
+               if (conn->reconnect_command_count == 0)
+                       imapc_connection_abort_commands(conn, NULL,
+                                               reconnecting);
                return;
        }