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