]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
p_clear() left only the smallest block, not the largest block
authorTimo Sirainen <tss@iki.fi>
Thu, 10 Apr 2003 22:37:01 +0000 (01:37 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 10 Apr 2003 22:37:01 +0000 (01:37 +0300)
--HG--
branch : HEAD

src/lib/mempool-alloconly.c

index f8b39c3996780601abf42b97170f2001dc0ed731..dc3f89863304675c250c8f5ed0c886caf5d1cb11 100644 (file)
@@ -240,10 +240,10 @@ static void pool_alloconly_clear(pool_t pool)
        struct alloconly_pool *apool = (struct alloconly_pool *) pool;
        struct pool_block *block;
 
-       /* destroy all blocks but the last, which is the largest */
+       /* destroy all blocks but the first, which is the largest */
        while (apool->block->prev != NULL) {
-               block = apool->block;
-               apool->block = block->prev;
+               block = apool->block->prev;
+               apool->block->prev = block->prev;
 
 #ifdef DEBUG
                memset(block, 0xde, SIZEOF_POOLBLOCK + block->size);
@@ -251,7 +251,7 @@ static void pool_alloconly_clear(pool_t pool)
                free(block);
        }
 
-       /* clear the last block */
+       /* clear the block */
        memset(POOL_BLOCK_DATA(apool->block), 0,
               apool->block->size - apool->block->left);
        apool->block->left = apool->block->size;