From 4dc3d8f8325994d737f1959c1554480f4ccbc60f Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 30 May 2025 08:12:49 +0100 Subject: Fix issue with memory allocations in lisp::serialise Was to do with sv_make. --- lib/sv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sv.c b/lib/sv.c index b2425b8..a83f303 100644 --- a/lib/sv.c +++ b/lib/sv.c @@ -60,7 +60,8 @@ sv_t sv_chop(sv_t sv, u64 size) sv_t sv_concat(arena_t *allocator, sv_t a, sv_t b) { - sv_t c = sv_make(allocator, a.data, a.size + b.size); + sv_t c = sv_make(allocator, NULL, a.size + b.size); + memcpy(c.data, a.data, a.size); memcpy(c.data + a.size, b.data, b.size); return c; } -- cgit v1.2.3-13-gbd6f