aboutsummaryrefslogtreecommitdiffstats
path: root/src/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/heap.c')
-rw-r--r--src/heap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/heap.c b/src/heap.c
index 52b5253..9a11cba 100644
--- a/src/heap.c
+++ b/src/heap.c
@@ -76,6 +76,8 @@ void free(void *buf)
return;
alloc_t *alloc = (alloc_t *)((uint8_t *)buf - sizeof(alloc_t));
+ if (alloc->next != 0)
+ return;
heap_used -= alloc->size;
alloc->next = free_blocks;
free_blocks = alloc;