]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: imapc_connection_disconnect_full() - Prevent leaking cmd->pool
authorMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 28 Feb 2022 14:50:05 +0000 (15:50 +0100)
committerMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Tue, 25 Oct 2022 05:48:54 +0000 (08:48 +0300)
If the imapc connection was already disconnected when calling
imapc_connection_disconnect() it didn't clean up the commands and
especially the command pools.

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

index 5730f947d410edc91bd35199225fcb19eb086c1a..f8ae0ca5f6f151a30ee16433bbbdd2eaa58c34b5 100644 (file)
@@ -446,6 +446,7 @@ 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);
                return;
        }