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