]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix memory leak when search accessed headers but found no mails
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 1 Mar 2018 15:59:34 +0000 (17:59 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 2 Mar 2018 09:25:36 +0000 (11:25 +0200)
For example fetching headers with UID FETCH for a nonexistent UID.

src/lib-storage/index/index-mail.c

index 89cb50f9f71e165ff58cd9f41d39b0ae77123643..8b163eac2421cb9aee8e74cf1b39ffdce073c127 100644 (file)
@@ -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);