diff options
-rw-r--r-- | lib/alloc/arena_realloc.c | 2 |
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); } |