summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-simple/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib/malloc-simple/alloc.c')
-rw-r--r--libc/stdlib/malloc-simple/alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
index b6a3cfcb6..1824507eb 100644
--- a/libc/stdlib/malloc-simple/alloc.c
+++ b/libc/stdlib/malloc-simple/alloc.c
@@ -107,7 +107,7 @@ void free(void *ptr)
#ifdef __UCLIBC_HAS_MMU__
if (ptr) {
ptr -= sizeof(size_t);
- munmap(ptr, * (size_t *) ptr);
+ munmap(ptr, * (size_t *) ptr + sizeof(size_t));
}
#else
munmap(ptr, 0);