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