Report more errors when allocating arrays

This commit is contained in:
Pierre Pronchery 2016-10-16 02:23:26 +02:00
parent 770a8578f0
commit 87f10c89f7

View File

@ -50,6 +50,7 @@ Array * array_new(size_t size)
/* check for overflows */
if(UINT32_MAX < SIZE_T_MAX && size > UINT32_MAX)
{
error_set_code(-ERANGE, "%s", strerror(ERANGE));
object_delete(array);
return NULL;
}