aboutsummaryrefslogtreecommitdiff
path: root/lib/alloc
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-14 17:48:14 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-14 17:48:14 +0200
commit454832b761f0f69a915be80188e7066d8cd45708 (patch)
treed348b8a9cc101120007dc9b17aeeee1e10d1e771 /lib/alloc
parent334ce7347e9217463ac13edaf8e1480cf08c9fcd (diff)
Fix bug in arena_realloc()
Diffstat (limited to 'lib/alloc')
-rw-r--r--lib/alloc/arena_realloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/alloc/arena_realloc.c b/lib/alloc/arena_realloc.c
index b30c1b2..6877ae1 100644
--- a/lib/alloc/arena_realloc.c
+++ b/lib/alloc/arena_realloc.c
@@ -58,5 +58,5 @@ arena_realloc(arena *a, void *ptr, size_t old, size_t new, size_t elemsz,
/* At this point we just make a new allocation and copy the data over */
void *dst = arena_alloc(a, new, elemsz, align);
- return dst == nullptr ? nullptr : memcpy(dst, ptr, new * elemsz);
+ return dst == nullptr ? nullptr : memcpy(dst, ptr, old * elemsz);
}