From: Markus Valentin Date: Thu, 3 Mar 2022 13:21:00 +0000 (+0100) Subject: imapc: imapc_connection_disconnect_full() - Only conditionally abort X-Git-Tag: 2.3.20~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2aa632260bd958d5007d1ce81785ce9792dc8c6d;p=thirdparty%2Fdovecot%2Fcore.git imapc: imapc_connection_disconnect_full() - Only conditionally abort 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 --- diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index f8ae0ca5f6..8527817434 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -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; }