]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Allow index_storage_mailbox_close() to be called without an opened view.
authorTimo Sirainen <tss@iki.fi>
Thu, 3 Sep 2015 16:58:39 +0000 (19:58 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 3 Sep 2015 16:58:39 +0000 (19:58 +0300)
Some failing mailbox_open() call may leave it in such a state.

src/lib-storage/index/index-storage.c

index df4ca0227214f1711e0784fc996064e77791778f..47f797a24a23776c00e46985b54656cf3a25f3d6 100644 (file)
@@ -362,7 +362,8 @@ void index_storage_mailbox_close(struct mailbox *box)
                mail_index_view_close(&box->view_pvt);
        if (box->index_pvt != NULL)
                mail_index_close(box->index_pvt);
-       mail_index_view_close(&box->view);
+       if (box->view != NULL)
+               mail_index_view_close(&box->view);
        mail_index_close(box->index);
        box->cache = NULL;