]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mailbox-list - Add duplicate pool for duplicate detection
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 19 Aug 2021 14:10:31 +0000 (17:10 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 7 Sep 2021 08:38:03 +0000 (08:38 +0000)
src/lib-storage/list/mailbox-list-index.c

index 2db0d47292db12c96008e5ddaddafef98fbde816..58bd2fc959a8a9097f82150190ffcf246af15099 100644 (file)
@@ -308,7 +308,9 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist,
 
        *error_r = NULL;
 
-       hash_table_create(&duplicate_hash, default_pool, 0,
+       pool_t dup_pool =
+               pool_alloconly_create(MEMPOOL_GROWING"duplicate pool", 2048);
+       hash_table_create(&duplicate_hash, dup_pool, 0,
                          mailbox_list_index_node_hash,
                          mailbox_list_index_node_cmp);
        count = mail_index_view_get_messages_count(view);
@@ -442,6 +444,7 @@ static int mailbox_list_index_parse_records(struct mailbox_list_index *ilist,
                }
        }
        hash_table_destroy(&duplicate_hash);
+       pool_unref(&dup_pool);
        return *error_r == NULL ? 0 : -1;
 }