Skip to content

Commit 7569c23

Browse files
committed
Fix false positive alarm in split_block() helper
The split_block() helper incorrectly triggered a panic when the requested size matched the block size. Adjust the condition to avoid the false positive alarm.
1 parent 2ad3517 commit 7569c23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static inline void split_block(memblock_t *block, size_t size)
140140
size_t remaining;
141141
memblock_t *new_block;
142142

143-
if (unlikely(size >= GET_SIZE(block))) {
143+
if (unlikely(size > GET_SIZE(block))) {
144144
panic(ERR_HEAP_CORRUPT);
145145
return;
146146
}

0 commit comments

Comments
 (0)