summaryrefslogtreecommitdiffstats
path: root/mx.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-12-13 08:10:12 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-12-13 08:10:12 +0000
commit776c52423d2445b091dce9d8071e304745d36bfa (patch)
tree46bce544b67ba95d5044155c03122cb207495e57 /mx.c
parent4d94d4f429ea115d67177c1b9a6afad4349f8b36 (diff)
Don't dump core when closing a NULL context. Fixes the "exit from
no-mailbox mode" bug.
Diffstat (limited to 'mx.c')
-rw-r--r--mx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mx.c b/mx.c
index ddf0d6fc..93c917fe 100644
--- a/mx.c
+++ b/mx.c
@@ -642,6 +642,9 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
void mx_fastclose_mailbox (CONTEXT *ctx)
{
int i;
+
+ if(!ctx)
+ return;
#ifdef USE_IMAP
if (ctx->magic == M_IMAP)
@@ -712,6 +715,8 @@ int mx_close_mailbox (CONTEXT *ctx)
char mbox[_POSIX_PATH_MAX];
char buf[SHORT_STRING];
+ if (!ctx) return 0;
+
ctx->closing = 1;
if (ctx->readonly || ctx->dontwrite)