From b468026540486ed70a9ddb71001a7154f7d29546 Mon Sep 17 00:00:00 2001 From: shchmue Date: Fri, 25 Oct 2019 11:41:30 -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;