]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
indexer-worker: Fix event leak on error handling
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 18 Aug 2021 14:54:00 +0000 (16:54 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 24 Sep 2021 06:55:20 +0000 (06:55 +0000)
src/indexer/master-connection.c

index d88f14dfda56da1872642e4658933d43f3c9ad95..4bbde1368ccbbebf6a4f2085a935a26b17d01982 100644 (file)
@@ -86,12 +86,14 @@ index_mailbox_precache(struct master_connection *conn, struct mailbox *box)
                                 &metadata) < 0) {
                e_error(index_event, "Precache-fields lookup failed: %s",
                        mailbox_get_last_internal_error(box, NULL));
+               event_unref(&index_event);
                return -1;
        }
        if (mailbox_get_status(box, STATUS_MESSAGES | STATUS_LAST_CACHED_SEQ,
                               &status) < 0) {
                e_error(index_event, "Status lookup failed: %s",
                        mailbox_get_last_internal_error(box, NULL));
+               event_unref(&index_event);
                return -1;
        }
        seq = status.last_cached_seq + 1;