From: Timo Sirainen Date: Thu, 20 Mar 2014 14:15:24 +0000 (+0200) Subject: imapc: Fixed crash when FETCH command immediately failed due to connection error. X-Git-Tag: 2.2.13.rc1~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7a672661c5642d6e8db9e96f7028b1af1e3255a;p=thirdparty%2Fdovecot%2Fcore.git imapc: Fixed crash when FETCH command immediately failed due to connection error. --- diff --git a/src/lib-storage/index/imapc/imapc-mail-fetch.c b/src/lib-storage/index/imapc/imapc-mail-fetch.c index c07bd82d82..8e3db34a78 100644 --- a/src/lib-storage/index/imapc/imapc-mail-fetch.c +++ b/src/lib-storage/index/imapc/imapc-mail-fetch.c @@ -385,9 +385,10 @@ void imapc_mail_fetch_flush(struct imapc_mailbox *mbox) imapc_mail_fetch_callback, mbox->pending_fetch_request); imapc_command_set_flags(cmd, IMAPC_COMMAND_FLAG_RETRIABLE); + array_append(&mbox->fetch_requests, &mbox->pending_fetch_request, 1); + imapc_command_send(cmd, str_c(mbox->pending_fetch_cmd)); - array_append(&mbox->fetch_requests, &mbox->pending_fetch_request, 1); mbox->pending_fetch_request = NULL; timeout_remove(&mbox->to_pending_fetch_send); str_truncate(mbox->pending_fetch_cmd, 0);