]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/runtime/in_pack_generic.c
Introduce xmallocarray, an overflow checking variant of xmalloc.
[thirdparty/gcc.git] / libgfortran / runtime / in_pack_generic.c
index 1b8c5584384dbee7463234a0374bea0bf923a3a9..aab155df68301aa1ee817810a1afc35aca6f6ea1 100644 (file)
@@ -180,7 +180,7 @@ internal_pack (gfc_array_char * source)
     return source->base_addr;
 
    /* Allocate storage for the destination.  */
-  destptr = xmalloc (ssize * size);
+  destptr = xmallocarray (ssize, size);
   dest = (char *)destptr;
   src = source->base_addr;
   stride0 = stride[0] * size;