]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix memory pool names with DEBUG_SILENT=1
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 14 Oct 2021 22:21:30 +0000 (00:21 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 23 Mar 2022 10:25:06 +0000 (10:25 +0000)
When compiling with --enable-devel-checks and running with DEBUG_SILENT=1,
the memory pool names were skipping over the first 8 bytes in the name.
This was supposed to be done only if the name begins with MEMPOOL_GROWING.

src/lib/mempool-alloconly.c

index 80c9a6b1caf0a9452944d4e001999eca146811f5..5e743d05f834263fe25a8b6da5c05b6d84dabf6f 100644 (file)
@@ -252,11 +252,11 @@ pool_t pool_alloconly_create(const char *name ATTR_UNUSED, size_t size)
        new_apool = p_new(&apool.pool, struct alloconly_pool, 1);
        *new_apool = apool;
 #ifdef DEBUG
-       if (str_begins(name, MEMPOOL_GROWING) ||
-           getenv("DEBUG_SILENT") != NULL) {
+       if (str_begins(name, MEMPOOL_GROWING)) {
                name += strlen(MEMPOOL_GROWING);
                new_apool->disable_warning = TRUE;
-       }
+       } else if (getenv("DEBUG_SILENT") != NULL)
+               new_apool->disable_warning = TRUE;
        new_apool->name = p_strdup(&new_apool->pool, name);
 
        /* set base_size so p_clear() doesn't trash alloconly_pool structure. */