]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: Fix memory leak with settings overrides
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Oct 2025 14:44:24 +0000 (17:44 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 15 Oct 2025 14:44:24 +0000 (17:44 +0300)
The setting override lookups were allocating memory from wrong memory pool,
causing the process memory to keep growing.

src/lib-settings/settings.c

index 347a26c65f5117e9cf8091e53025c6faaef7605a..6b22ce3a384512d3de6d422ce1abb56ef5dfa086 100644 (file)
@@ -1862,7 +1862,7 @@ settings_override_set_blocks(struct settings_mmap *mmap,
                return -1;
        }
 
-       const char **block_names = p_new(mmap->pool, const char *, count + 1);
+       const char **block_names = p_new(set->pool, const char *, count + 1);
        for (i = 0; i < count; i++) {
                memcpy(&block_idx, blocks, sizeof(block_idx));
                blocks = CONST_PTR_OFFSET(blocks, sizeof(block_idx));