dovecot-1.2: mbox: Don't crash if saving fails because of write ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 5 18:43:52 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/327c893590c3
changeset: 8244:327c893590c3
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 05 18:43:48 2008 +0300
description:
mbox: Don't crash if saving fails because of write error (out of disk space).

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib-storage/index/mbox/mbox-save.c |    3 ++-

diffs (13 lines):

diff -r 9cabb706d3df -r 327c893590c3 src/lib-storage/index/mbox/mbox-save.c
--- a/src/lib-storage/index/mbox/mbox-save.c	Sun Oct 05 17:21:36 2008 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c	Sun Oct 05 18:43:48 2008 +0300
@@ -790,7 +790,8 @@ void mbox_transaction_save_rollback(stru
 		/* failed, truncate file back to original size.
 		   output stream needs to be flushed before truncating
 		   so unref() won't write anything. */
-		o_stream_flush(ctx->output);
+		if (ctx->output != NULL)
+			o_stream_flush(ctx->output);
 
 		if (ftruncate(mbox->mbox_fd, (off_t)ctx->append_offset) < 0)
 			mbox_set_syscall_error(mbox, "ftruncate()");


More information about the dovecot-cvs mailing list