r19249@catbus: nickm | 2008-04-08 14:04:02 -0400

Oops. Fix one last memarea freelist bug.


svn:r14322
This commit is contained in:
Nick Mathewson 2008-04-08 18:04:05 +00:00
parent a725d5da5e
commit 98aea7186c

View File

@ -177,7 +177,7 @@ memarea_alloc(memarea_t *area, size_t sz)
char *result; char *result;
tor_assert(chunk); tor_assert(chunk);
if (chunk->next_mem+sz > chunk->u.mem+chunk->mem_size) { if (chunk->next_mem+sz > chunk->u.mem+chunk->mem_size) {
if (sz+CHUNK_HEADER_SIZE >= area->chunk_size) { if (sz+CHUNK_HEADER_SIZE >= CHUNK_SIZE) {
/* This allocation is too big. Stick it in a special chunk, and put /* This allocation is too big. Stick it in a special chunk, and put
* that chunk second in the list. */ * that chunk second in the list. */
memarea_chunk_t *new_chunk = alloc_chunk(sz+CHUNK_HEADER_SIZE, 0); memarea_chunk_t *new_chunk = alloc_chunk(sz+CHUNK_HEADER_SIZE, 0);