diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-13 08:10:12 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-13 08:10:12 +0000 |
commit | 776c52423d2445b091dce9d8071e304745d36bfa (patch) | |
tree | 46bce544b67ba95d5044155c03122cb207495e57 /mx.c | |
parent | 4d94d4f429ea115d67177c1b9a6afad4349f8b36 (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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |