Do not de-allocate this array when some allocation error happens.
The data is defined outside of this function, so leave it to the caller to handle deallocation.
This allows for giving the caller more choices when trying to decided what to do on allocation problem.
For example, some program may want to try to continue anyway even if there is an allocation problem.
It will be tricky, but in such a case one would just have to make do with what is already allocated.