From 2bed33710647bd3f2d4ee76ab18818bbf2119dee Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 18 Oct 2009 15:23:15 -0400 Subject: [PATCH] mail_storage_copy(): Don't unreference keywords too many times. --HG-- branch : HEAD --- src/lib-storage/mail-copy.c | 6 ++++++ 1 file changed, 6 insertions(+) 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"); -- 2.47.3