From c64c590abb226fcc71db8499c3db5ad0b74d6258 Mon Sep 17 00:00:00 2001 From: SpookyDervish Date: Sun, 12 Apr 2026 07:50:03 +1000 Subject: [PATCH] handle some more memory allocation errors --- libs/collections/list.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/collections/list.c b/libs/collections/list.c index 72fcb50..126dc11 100644 --- a/libs/collections/list.c +++ b/libs/collections/list.c @@ -372,6 +372,9 @@ GroundValue reverseListStruct(GroundScope* scope, List args) { GroundValue* items = (GroundValue*)ptrField->value.data.intVal; GroundValue* newBuffer = calloc(capacity, sizeof(GroundValue)); + if (newBuffer == NULL) { + ERROR("Failed to allocate memory when reversing list!", "MemoryAllocationFailed"); + } int z = 0; for (int i = size - 1; i >= 0; i--, z++) {