]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: Don't assert-crash when saving a message without locking uidlist.
authorTimo Sirainen <tss@iki.fi>
Tue, 5 Oct 2010 01:20:31 +0000 (02:20 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 5 Oct 2010 01:20:31 +0000 (02:20 +0100)
src/lib-storage/index/maildir/maildir-save.c

index 12eeaabe645ca51bf1835904e52ddc22d2fc8606..b272d482cad0abb7a95891236af318512e1e5325 100644 (file)
@@ -854,7 +854,11 @@ maildir_save_move_files_to_newcur(struct maildir_save_context *ctx)
                prev_mf = mf;
        }
 
-       maildir_sync_set_new_msgs_count(ctx->sync_ctx, array_count(&files));
+       if (ctx->locked) {
+               i_assert(ctx->sync_ctx != NULL);
+               maildir_sync_set_new_msgs_count(ctx->sync_ctx,
+                                               array_count(&files));
+       }
        return maildir_transaction_fsync_dirs(ctx, new_changed, cur_changed);
 }