From cce2c9d27b2df5c0a55ce201b3fca1c9a5e58dcf Mon Sep 17 00:00:00 2001 From: shchmue Date: Fri, 25 Oct 2019 18:54:22 -0600 Subject: [PATCH] heap: Prevent node chain collapse on free --- source/mem/heap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/mem/heap.c b/source/mem/heap.c index 4971d8a..fd46c16 100644 --- a/source/mem/heap.c +++ b/source/mem/heap.c @@ -56,6 +56,7 @@ static u32 _heap_alloc(heap_t *heap, u32 size, u32 alignment) node->used = 1; new->used = 0; new->next = node->next; + new->next->prev = new; new->prev = node; node->next = new;