From: Timo Sirainen Date: Thu, 1 Mar 2018 15:59:34 +0000 (+0200) Subject: lib-storage: Fix memory leak when search accessed headers but found no mails X-Git-Tag: 2.3.9~2191 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=293f69e28bd1cbe882907e8444d6b82f9995d6cb;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix memory leak when search accessed headers but found no mails For example fetching headers with UID FETCH for a nonexistent UID. --- diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 89cb50f9f7..8b163eac24 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -2081,6 +2081,7 @@ void index_mail_free(struct mail *_mail) if (array_is_created(&mail->header_match_lines)) array_free(&mail->header_match_lines); + mailbox_header_lookup_unref(&mail->data.wanted_headers); mailbox_header_lookup_unref(&mail->mail.wanted_headers); event_unref(&_mail->event); pool_unref(&mail->mail.data_pool);