Skip to content

Commit

Permalink
doveadm: Unref header search context after use
Browse files Browse the repository at this point in the history
Fixes memory leak, found by valgrind
  • Loading branch information
cmouse committed Dec 29, 2017
1 parent 5f08b03 commit 4a1e2e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/doveadm/doveadm-mail-iter.c
Expand Up @@ -61,6 +61,8 @@ int doveadm_mail_iter_init(struct doveadm_mail_cmd_context *ctx,
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);
*iter_r = iter;
return 0;
}
Expand Down

0 comments on commit 4a1e2e8

Please sign in to comment.