]> 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>
Mon, 12 Mar 2018 09:58:54 +0000 (11:58 +0200)
For example fetching headers with UID FETCH for a nonexistent UID.

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

index a53aba5e4633d6ce1237ec3b7b49e62666e8c427..2001427e8e35b7f40ba30c511daca042139e47dd 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);