Skip to content

Commit

Permalink
maildir: Don't crash with zlib plugin when saving is aborted
Browse files Browse the repository at this point in the history
The ostream can be finished even if the saving had already failed. It gets
deleted anyway.

Fixes:
Panic: file ostream-zlib.c: line 37 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0 || zstream->ostream.error_handling_disabled)
  • Loading branch information
sirainen authored and villesavolainen committed Feb 6, 2019
1 parent d83ff88 commit 1f9bb88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-storage/index/maildir/maildir-save.c
Expand Up @@ -510,7 +510,7 @@ static int maildir_save_finish_real(struct mail_save_context *_ctx)
}

path = t_strconcat(ctx->tmpdir, "/", ctx->file_last->tmp_name, NULL);
if (!ctx->failed && o_stream_finish(_ctx->data.output) < 0) {
if (o_stream_finish(_ctx->data.output) < 0) {
if (!mail_storage_set_error_from_errno(storage)) {
mail_set_critical(_ctx->dest_mail,
"write(%s) failed: %s", path,
Expand Down

0 comments on commit 1f9bb88

Please sign in to comment.