]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/pack_i16.c
Introduce xmallocarray, an overflow checking variant of xmalloc.
[thirdparty/gcc.git] / libgfortran / generated / pack_i16.c
index da1faefd450254316ed36ac87b9244f2ece28a51..01d32ad0fadf61f76ac7c56478bfb713f0f7a7d2 100644 (file)
@@ -167,8 +167,8 @@ pack_i16 (gfc_array_i16 *ret, const gfc_array_i16 *array,
 
          ret->offset = 0;
 
-         /* xmalloc allocates a single byte for zero size.  */
-         ret->base_addr = xmalloc (sizeof (GFC_INTEGER_16) * total);
+         /* xmallocarray allocates a single byte for zero size.  */
+         ret->base_addr = xmallocarray (total, sizeof (GFC_INTEGER_16));
 
          if (total == 0)
            return;