dovecot-1.1: mbox: Don't crash if saving is aborted early.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Jun 19 08:15:30 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/bd143daa924f
changeset: 7687:bd143daa924f
user: Timo Sirainen <tss at iki.fi>
date: Thu Jun 19 08:13:36 2008 +0300
description:
mbox: Don't crash if saving is aborted early.
diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
src/lib-storage/index/mbox/mbox-save.c | 8 +++++---
diffs (18 lines):
diff -r a533e2cf29d1 -r bd143daa924f src/lib-storage/index/mbox/mbox-save.c
--- a/src/lib-storage/index/mbox/mbox-save.c Thu Jun 19 01:44:00 2008 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c Thu Jun 19 08:13:36 2008 +0300
@@ -654,9 +654,11 @@ int mbox_save_finish(struct mail_save_co
{
struct mbox_save_context *ctx = (struct mbox_save_context *)_ctx;
- /* make sure everything is written */
- if (o_stream_flush(ctx->output) < 0)
- return write_error(ctx);
+ if (ctx->output != NULL) {
+ /* make sure everything is written */
+ if (o_stream_flush(ctx->output) < 0)
+ return write_error(ctx);
+ }
ctx->finished = TRUE;
if (!ctx->failed) {
More information about the dovecot-cvs
mailing list