Skip to content

Commit 5ca5520

Browse files
committed
ea_malloc: Fix defrag_free_list block size bug.
Fixes #864.
1 parent d6f7407 commit 5ca5520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ea_malloc/malloc_freelist.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/*
2222
* This is the container for our free-list.
23-
* Node the usage of the linked list here: the library uses offsetof
23+
* Note the usage of the linked list here: the library uses offsetof
2424
* and container_of to manage the list and get back to the parent struct.
2525
*/
2626
typedef struct
@@ -67,7 +67,7 @@ void defrag_free_list(void)
6767
{
6868
if((((uintptr_t)&lb->block) + lb->size) == (uintptr_t)b)
6969
{
70-
lb->size += sizeof(*b) + b->size;
70+
lb->size += ALLOC_HEADER_SZ + b->size;
7171
list_del(&b->node);
7272
continue;
7373
}

0 commit comments

Comments
 (0)