changeset 3145:941e381733a8 HEAD

Don't try to access closed mailbox after the closing gives an error.
author Timo Sirainen <tss@iki.fi>
date Tue, 08 Feb 2005 13:16:52 +0200
parents 33cbe3dec3b8
children 9a8bf1c86699
files src/imap/cmd-select.c src/imap/cmd-unselect.c
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-select.c	Tue Feb 08 13:03:17 2005 +0200
+++ b/src/imap/cmd-select.c	Tue Feb 08 13:16:52 2005 +0200
@@ -19,10 +19,10 @@
 	if (client->mailbox != NULL) {
 		box = client->mailbox;
 		client->mailbox = NULL;
-		if (mailbox_close(box) < 0) {
-			client_send_untagged_storage_error(client,
-				mailbox_get_storage(box));
-		}
+
+                storage = mailbox_get_storage(box);
+		if (mailbox_close(box) < 0)
+			client_send_untagged_storage_error(client, storage);
 	}
 
 	storage = client_find_storage(cmd, &mailbox);
--- a/src/imap/cmd-unselect.c	Tue Feb 08 13:03:17 2005 +0200
+++ b/src/imap/cmd-unselect.c	Tue Feb 08 13:16:52 2005 +0200
@@ -7,16 +7,16 @@
 {
 	struct client *client = cmd->client;
 	struct mailbox *mailbox = client->mailbox;
+	struct mail_storage *storage;
 
 	if (!client_verify_open_mailbox(cmd))
 		return TRUE;
 
 	client->mailbox = NULL;
 
-	if (mailbox_close(mailbox) < 0) {
-		client_send_untagged_storage_error(client,
-						   mailbox_get_storage(mailbox));
-	}
+	storage = mailbox_get_storage(mailbox);
+	if (mailbox_close(mailbox) < 0)
+		client_send_untagged_storage_error(client, storage);
 
 	client_send_tagline(cmd, "OK Unselect completed.");
 	return TRUE;