From 00403c8efbc09d34a9e428f567cddc5b95632236 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Thu, 4 Apr 2019 07:28:03 +0000 Subject: [PATCH] Disable mailbox notify on close This fixes a crash when two mailboxes have been opened within a session, and an 'unmailboxes *' command is issued. In this case, both the current mailbox and the previously opened mailbox have a non-NULL `notify` member. The notify method assumes the mailbox is currently active within the context. The context gets thus doubly freed. --- mx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mx.c b/mx.c index b354ef6f7..3b1b65be5 100644 --- a/mx.c +++ b/mx.c @@ -384,6 +384,7 @@ void mx_fastclose_mailbox(struct Mailbox *m) m->mx_ops->mbox_close(m); mutt_mailbox_changed(m, MBN_CLOSED); + m->notify = NULL; mutt_hash_free(&m->subj_hash); mutt_hash_free(&m->id_hash); -- 2.40.0