dovecot: Error handling fixes

dovecot at dovecot.org dovecot at dovecot.org
Sat Dec 1 09:09:54 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/fed2843b4ab8
changeset: 6879:fed2843b4ab8
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Dec 01 09:09:47 2007 +0200
description:
Error handling fixes

diffstat:

1 file changed, 5 insertions(+), 3 deletions(-)
src/lib-storage/index/maildir/maildir-save.c |    8 +++++---

diffs (29 lines):

diff -r 0c3ab0aef33c -r fed2843b4ab8 src/lib-storage/index/maildir/maildir-save.c
--- a/src/lib-storage/index/maildir/maildir-save.c	Sat Dec 01 09:09:21 2007 +0200
+++ b/src/lib-storage/index/maildir/maildir-save.c	Sat Dec 01 09:09:47 2007 +0200
@@ -702,9 +702,11 @@ int maildir_transaction_save_commit_pre(
 		   Dovecot instances haven't yet seen the files. */
 		maildir_transaction_unlink_copied_files(ctx, mf);
 
-		maildir_keywords_sync_deinit(&ctx->keywords_sync_ctx);
+		if (ctx->keywords_sync_ctx != NULL)
+			maildir_keywords_sync_deinit(&ctx->keywords_sync_ctx);
 		/* returning failure finishes the save_context */
 		maildir_transaction_save_rollback(ctx);
+		return -1;
 	}
 
 	if (ctx->mail != NULL)
@@ -755,10 +757,10 @@ void maildir_transaction_save_rollback(s
 	if (hardlinks)
 		maildir_transaction_unlink_copied_files(ctx, NULL);
 
-	if (ctx->locked) {
+	if (ctx->uidlist_sync_ctx != NULL)
 		(void)maildir_uidlist_sync_deinit(&ctx->uidlist_sync_ctx);
+	if (ctx->locked)
 		maildir_uidlist_unlock(ctx->mbox->uidlist);
-	}
 	if (ctx->sync_ctx != NULL)
 		(void)maildir_sync_index_finish(&ctx->sync_ctx, TRUE, FALSE);
 


More information about the dovecot-cvs mailing list