diff --git a/src/gc_malloc.c b/src/gc_malloc.c index 8efb5b2..f593cca 100644 --- a/src/gc_malloc.c +++ b/src/gc_malloc.c @@ -228,6 +228,6 @@ void destroy_heap(struct gc_chunk *freelist) while (curr->size != 0) { struct gc_chunk *next = curr->next; munmap(curr, curr->size); - curr = curr->next; + curr = next; } }