From: Timo Sirainen Date: Sat, 25 Oct 2008 20:34:02 +0000 (+0300) Subject: SELECT: If closing old mailbox gives an error, don't crash. X-Git-Tag: 1.2.alpha4~150 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebda08f30dd2baf31555199b4a6d9c2e504ec7e2;p=thirdparty%2Fdovecot%2Fcore.git SELECT: If closing old mailbox gives an error, don't crash. --HG-- branch : HEAD --- diff --git a/src/imap/cmd-select.c b/src/imap/cmd-select.c index bdfa87c66b..1e912f586c 100644 --- a/src/imap/cmd-select.c +++ b/src/imap/cmd-select.c @@ -359,14 +359,15 @@ bool cmd_select_full(struct client_command_context *cmd, bool readonly) client->mailbox_change_lock = cmd; if (client->mailbox != NULL) { + struct mail_storage *old_storage = + mailbox_get_storage(client->mailbox); + client_search_updates_free(client); box = client->mailbox; client->mailbox = NULL; - if (mailbox_close(&box) < 0) { - client_send_untagged_storage_error(client, - mailbox_get_storage(box)); - } + if (mailbox_close(&box) < 0) + client_send_untagged_storage_error(client, old_storage); /* CLOSED response is required by QRESYNC */ client_send_line(client, "* OK [CLOSED]"); }