forked from ground/ground
handle some more memory allocation errors
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user