From 89b3a53140d31bfa0f34378bf7ee1f52da954961 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 6 May 2016 22:24:20 +0300 Subject: [PATCH] imap: Avoid assert-crash after a failed mailbox sync. We didn't close the mailbox and we didn't update message counts, so we could have crashed with: Panic: Message count decreased --- src/imap/imap-sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imap/imap-sync.c b/src/imap/imap-sync.c index 5403605cf9..50ef1f3048 100644 --- a/src/imap/imap-sync.c +++ b/src/imap/imap-sync.c @@ -315,7 +315,7 @@ static int imap_sync_finish(struct imap_sync_context *ctx, bool aborting) if (mailbox_sync_deinit(&ctx->sync_ctx, &ctx->sync_status) < 0 || ctx->failed) { ctx->failed = TRUE; - return -1; + ret = -1; } mailbox_get_open_status(ctx->box, STATUS_UIDVALIDITY | STATUS_MESSAGES | STATUS_RECENT |