diff --git a/c/malloc_speed_test/pool_list.c b/c/malloc_speed_test/pool_list.c index 4ff0f8d..b6034e7 100644 --- a/c/malloc_speed_test/pool_list.c +++ b/c/malloc_speed_test/pool_list.c @@ -73,13 +73,12 @@ inline void pool_free(void *p) return; struct block_s *b1 = (struct block_s *)(p - 2 * sizeof(struct block_s *)), - *b0 = b1->prev, *b2 = b1->next; - if (b0) - b0->next = b2; + if (b1->prev) + b1->prev->next = b2; if (b2) - b2->prev = b0; + b2->prev = b1->prev; if (free_pool) { b1->next = free_pool;