# HG changeset patch # User Olaf Wintermann # Date 1732819020 -3600 # Node ID d3d4f245b843eab279a92f2ca62492fcd87dc365 # Parent 3603bdf4a78b5560547ce2d010a30c30a3f38151 fix cx_array_advanced_realloc to handle reallocation of NULL arrays, consistent with standard realloc behavior diff -r 3603bdf4a78b -r d3d4f245b843 src/array_list.c --- a/src/array_list.c Wed Nov 27 22:33:30 2024 +0100 +++ b/src/array_list.c Thu Nov 28 19:37:00 2024 +0100 @@ -63,7 +63,7 @@ void *newmem; if (array == alloc->ptr2) { newmem = cxMalloc(al, capacity * elem_size); - if (newmem != NULL) { + if (newmem != NULL && array != NULL) { memcpy(newmem, array, capacity * elem_size); } } else {