]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Fixed crash with pop3_lock_session=yes if dotlock already existed.
authorTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 19:48:18 +0000 (14:48 -0500)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 19:48:18 +0000 (14:48 -0500)
--HG--
branch : HEAD

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

index 1f5d34c33723f46a029e6d69e84796f02ca6bf89..f87119f8f8d1b283ada66b6cae628a87eb9c28a1 100644 (file)
@@ -576,6 +576,9 @@ mbox_alloc_mailbox(struct mbox_storage *storage, struct mail_index *index,
        if ((storage->storage.flags & MAIL_STORAGE_FLAG_KEEP_HEADER_MD5) != 0)
                mbox->mbox_save_md5 = TRUE;
 
+       index_storage_mailbox_init(&mbox->ibox, name, flags,
+                                  want_memory_indexes(storage, path));
+
        if ((flags & MAILBOX_OPEN_KEEP_LOCKED) != 0) {
                if (mbox_lock(mbox, F_WRLCK, &mbox->mbox_global_lock_id) <= 0) {
                        struct mailbox *box = &mbox->ibox.box;
@@ -591,8 +594,6 @@ mbox_alloc_mailbox(struct mbox_storage *storage, struct mail_index *index,
                }
        }
 
-       index_storage_mailbox_init(&mbox->ibox, name, flags,
-                                  want_memory_indexes(storage, path));
        return mbox;
 }