# HG changeset patch # User Timo Sirainen # Date 1487096407 -7200 # Node ID 4a2884480ddcb5352692a1effadce1c9b1bf74a3 # Parent f48743eb38c6c44ca1222d6fb890c9e4ac8a82cb lib-lda: Don't set mail_deliver_context.dest_mail too early. It must be NULL for the caller, unless save_dest_mail==TRUE diff -r f48743eb38c6 -r 4a2884480ddc src/lib-lda/mail-deliver.c --- a/src/lib-lda/mail-deliver.c Mon Feb 13 20:49:12 2017 +0200 +++ b/src/lib-lda/mail-deliver.c Tue Feb 14 20:20:07 2017 +0200 @@ -326,6 +326,7 @@ struct mail_save_context *save_ctx; struct mailbox_header_lookup_ctx *headers_ctx; struct mail_keywords *kw; + struct mail *dest_mail; enum mail_error error; const char *mailbox_name, *errstr, *guid; struct mail_transaction_commit_changes changes; @@ -369,8 +370,8 @@ mailbox_save_set_flags(save_ctx, flags, kw); headers_ctx = mailbox_header_lookup_init(box, lda_log_wanted_headers); - ctx->dest_mail = mailbox_save_get_dest_mail(save_ctx); - mail_add_temp_wanted_fields(ctx->dest_mail, lda_log_wanted_fetch_fields, NULL); + dest_mail = mailbox_save_get_dest_mail(save_ctx); + mail_add_temp_wanted_fields(dest_mail, lda_log_wanted_fetch_fields, NULL); mailbox_header_lookup_unref(&headers_ctx); mail_deliver_deduplicate_guid_if_needed(ctx->session, save_ctx);