dovecot-2.0: maildir, sdbox: If committed transaction has only a...

dovecot at dovecot.org dovecot at dovecot.org
Sat Mar 12 17:18:49 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/b896d72d7fa7
changeset: 12675:b896d72d7fa7
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Mar 12 17:18:47 2011 +0200
description:
maildir, sdbox: If committed transaction has only aborted msg saves, don't assert-crash.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-save.c |  6 +++++-
 src/lib-storage/index/maildir/maildir-save.c   |  6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 4b537650b4de -r b896d72d7fa7 src/lib-storage/index/dbox-single/sdbox-save.c
--- a/src/lib-storage/index/dbox-single/sdbox-save.c	Sat Mar 12 15:48:24 2011 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-save.c	Sat Mar 12 17:18:47 2011 +0200
@@ -265,8 +265,12 @@
 
 	i_assert(ctx->ctx.finished);
 
-	if (array_count(&ctx->files) == 0)
+	if (array_count(&ctx->files) == 0) {
+		/* the mail must be freed in the commit_pre() */
+		if (ctx->ctx.mail != NULL)
+			mail_free(&ctx->ctx.mail);
 		return 0;
+	}
 
 	if (sdbox_sync_begin(ctx->mbox, SDBOX_SYNC_FLAG_FORCE |
 			     SDBOX_SYNC_FLAG_FSYNC, &ctx->sync_ctx) < 0) {
diff -r 4b537650b4de -r b896d72d7fa7 src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Sat Mar 12 15:48:24 2011 +0200
+++ b/src/lib-storage/index/maildir/maildir-save.c	Sat Mar 12 17:18:47 2011 +0200
@@ -927,8 +927,12 @@
 	i_assert(_ctx->output == NULL);
 	i_assert(ctx->last_save_finished);
 
-	if (ctx->files_count == 0)
+	if (ctx->files_count == 0) {
+		/* the mail must be freed in the commit_pre() */
+		if (ctx->mail != NULL)
+			mail_free(&ctx->mail);
 		return 0;
+	}
 
 	sync_flags = MAILDIR_UIDLIST_SYNC_PARTIAL |
 		MAILDIR_UIDLIST_SYNC_NOREFRESH;


More information about the dovecot-cvs mailing list