}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_INTEGER_1));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_INTEGER_1));
if (rs <= 0)
return;
}
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_INTEGER_1));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_INTEGER_1));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}