From 454832b761f0f69a915be80188e7066d8cd45708 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 14 May 2024 17:48:14 +0200 Subject: Fix bug in arena_realloc() --- lib/alloc/arena_realloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v1.2.3