From: Timo Sirainen Date: Sun, 18 Oct 2009 19:23:15 +0000 (-0400) Subject: mail_storage_copy(): Don't unreference keywords too many times. X-Git-Tag: 2.0.alpha2~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2bed33710647bd3f2d4ee76ab18818bbf2119dee;p=thirdparty%2Fdovecot%2Fcore.git mail_storage_copy(): Don't unreference keywords too many times. --HG-- branch : HEAD --- diff --git a/src/lib-storage/mail-copy.c b/src/lib-storage/mail-copy.c index 9d94c32e23..e60901c321 100644 --- a/src/lib-storage/mail-copy.c +++ b/src/lib-storage/mail-copy.c @@ -48,6 +48,12 @@ int mail_storage_copy(struct mail_save_context *ctx, struct mail *mail) break; } while (i_stream_read(input) != -1); + if (ctx->keywords != NULL) { + /* keywords gets unreferenced twice, because we call + mailbox_save_cancel/finish */ + mailbox_keywords_ref(ctx->transaction->box, ctx->keywords); + } + if (input->stream_errno != 0) { mail_storage_set_critical(ctx->transaction->box->storage, "copy: i_stream_read() failed: %m");