summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/stdlib/malloc/realloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index db26866de..e4c8ad710 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -57,7 +57,7 @@ realloc (void *mem, size_t new_size)
if (extra)
/* Record the changed size. */
- MALLOC_SET_SIZE (base_mem, new_size);
+ MALLOC_SET_SIZE (base_mem, size + extra);
else
/* Our attempts to extend MEM in place failed, just
allocate-and-copy. */