pgpool2.git / summary / log / commit / refs

commit    82f8b732a730199dca0a7b91c831e9d7103fcfb7
Author:   Yoshiyuki Asaba <y-asaba at pgfoundry.org>
Date:     Mon Nov 13 05:02:50 2006 +0000

    Fix SIGSEGV under parallel mode.


parser/pool_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/pool_memory.c b/parser/pool_memory.c index 1f8c5ed06..3f0f085c0 100644 --- a/parser/pool_memory.c +++ b/parser/pool_memory.c @@ -61,7 +61,7 @@ void *pool_memory_alloc(POOL_MEMORY_POOL *pool, unsigned int size) POOL_BLOCK *block; POOL_CHUNK *chunk; - if (size > MAX_SIZE) + if ((size + POOL_HEADER_SIZE) > MAX_SIZE) { block = malloc(sizeof(POOL_BLOCK)); if (block == NULL) @@ -84,7 +84,7 @@ void *pool_memory_alloc(POOL_MEMORY_POOL *pool, unsigned int size) } else { - int fidx = get_free_index(size); + int fidx = get_free_index(size + POOL_HEADER_SIZE); int allocsize = 1 << (fidx + ALIGN); /* pick up from freelist */ [parent: efc425c1356b]