iter->t = mailbox_transaction_begin(iter->box, 0, ctx->cmd->name);
iter->search_ctx = mailbox_search_init(iter->t, search_args, NULL,
wanted_fields, headers_ctx);
- if (headers_ctx != NULL)
- mailbox_header_lookup_unref(&headers_ctx);
+ mailbox_header_lookup_unref(&headers_ctx);
*iter_r = iter;
return 0;
}
(void)mailbox_attribute_iter_deinit(&exporter->attr_iter);
dsync_mailbox_export_body_search_deinit(exporter);
(void)mailbox_transaction_commit(&exporter->trans);
- if (exporter->wanted_headers != NULL)
- mailbox_header_lookup_unref(&exporter->wanted_headers);
+ mailbox_header_lookup_unref(&exporter->wanted_headers);
i_stream_unref(&exporter->attr.value_stream);
hash_table_destroy(&exporter->export_guids);
ctx->state.cur_str = str_new(default_pool, 8192);
ctx->state.fetching = TRUE;
- if (wanted_headers != NULL)
- mailbox_header_lookup_unref(&wanted_headers);
+ mailbox_header_lookup_unref(&wanted_headers);
}
static int imap_fetch_flush_buffer(struct imap_fetch_context *ctx)
void imap_msgpart_close_mailbox(struct imap_msgpart *msgpart)
{
- if (msgpart->header_ctx != NULL)
- mailbox_header_lookup_unref(&msgpart->header_ctx);
+ mailbox_header_lookup_unref(&msgpart->header_ctx);
}
memory until this point. */
mail_cache_close_mail(_mail->transaction->cache_trans, _mail->seq);
- if (mail->data.wanted_headers != NULL)
- mailbox_header_lookup_unref(&mail->data.wanted_headers);
+ mailbox_header_lookup_unref(&mail->data.wanted_headers);
if (!mail->freeing)
index_mail_reset_data(mail);
}
if (array_is_created(&mail->header_match_lines))
array_free(&mail->header_match_lines);
- if (headers_ctx != NULL)
- mailbox_header_lookup_unref(&headers_ctx);
+ mailbox_header_lookup_unref(&headers_ctx);
event_unref(&_mail->event);
pool_unref(&mail->mail.data_pool);
pool_unref(&mail->mail.pool);
}
}
}
- if (headers_ctx != NULL)
- mailbox_header_lookup_unref(&headers_ctx);
+ mailbox_header_lookup_unref(&headers_ctx);
if (failed) {
/* opening mail failed. maybe because of lookup_abort.
(void)mail_search_args_foreach(ctx->mail_ctx.args->args,
search_arg_deinit, ctx);
- if (ctx->mail_ctx.wanted_headers != NULL)
- mailbox_header_lookup_unref(&ctx->mail_ctx.wanted_headers);
+ mailbox_header_lookup_unref(&ctx->mail_ctx.wanted_headers);
if (ctx->mail_ctx.sort_program != NULL) {
if (index_sort_program_deinit(&ctx->mail_ctx.sort_program) < 0)
ret = -1;
wanted_fields |= MAIL_FETCH_VIRTUAL_SIZE;
mail_add_temp_wanted_fields(mail, wanted_fields, wanted_headers);
- if (wanted_headers != NULL)
- mailbox_header_lookup_unref(&wanted_headers);
+ mailbox_header_lookup_unref(&wanted_headers);
}
static void
mail_free(&mails[i]);
array_free(&vmail->backend_mails);
- if (vmail->wanted_headers != NULL)
- mailbox_header_lookup_unref(&vmail->wanted_headers);
+ mailbox_header_lookup_unref(&vmail->wanted_headers);
pool_unref(&vmail->imail.mail.data_pool);
pool_unref(&vmail->imail.mail.pool);
vmail->wanted_headers->name);
vmail->cur_backend_mail =
mail_alloc(backend_trans, vmail->wanted_fields, backend_headers);
- if (backend_headers != NULL)
- mailbox_header_lookup_unref(&backend_headers);
+ mailbox_header_lookup_unref(&backend_headers);
backend_pmail = (struct mail_private *)vmail->cur_backend_mail;
backend_pmail->vmail = mail;