From 9b1695b9f2eda40c61bd201607d9296ebaf37c78 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 21 Apr 2026 21:34:40 +0300 Subject: fix(A_new): Handle out of memory condition --- Array.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Array.c b/Array.c index 2df6d0b..60dc82d 100644 --- a/Array.c +++ b/Array.c @@ -31,6 +31,9 @@ A_new(BumpArena b, usize element_size, usize length) { }; void* start = B_alloc(b, sizeof(am) + element_size * length); + if (NULL == start) + return NULL; + memcpy(start, &am, sizeof(am)); return start + sizeof(am); } -- cgit v1.2.3