src/array_list.c

changeset 995
d3d4f245b843
parent 986
38fa7e41194c
child 998
bb196054f3fd
equal deleted inserted replaced
994:3603bdf4a78b 995:d3d4f245b843
61 61
62 // check if the array is still located on the stack 62 // check if the array is still located on the stack
63 void *newmem; 63 void *newmem;
64 if (array == alloc->ptr2) { 64 if (array == alloc->ptr2) {
65 newmem = cxMalloc(al, capacity * elem_size); 65 newmem = cxMalloc(al, capacity * elem_size);
66 if (newmem != NULL) { 66 if (newmem != NULL && array != NULL) {
67 memcpy(newmem, array, capacity * elem_size); 67 memcpy(newmem, array, capacity * elem_size);
68 } 68 }
69 } else { 69 } else {
70 newmem = cxRealloc(al, array, capacity * elem_size); 70 newmem = cxRealloc(al, array, capacity * elem_size);
71 } 71 }

mercurial