From: Timo Sirainen Date: Thu, 10 Apr 2003 22:37:01 +0000 (+0300) Subject: p_clear() left only the smallest block, not the largest block X-Git-Tag: 1.1.alpha1~4756 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0abc51fab0fe288f4aa4d40cd61ea5c01a0e1dcd;p=thirdparty%2Fdovecot%2Fcore.git p_clear() left only the smallest block, not the largest block --HG-- branch : HEAD --- diff --git a/src/lib/mempool-alloconly.c b/src/lib/mempool-alloconly.c index f8b39c3996..dc3f898633 100644 --- a/src/lib/mempool-alloconly.c +++ b/src/lib/mempool-alloconly.c @@ -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;