about summary refs log tree commit diff
path: root/malloc/reallocarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/reallocarray.c')
-rw-r--r--malloc/reallocarray.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/malloc/reallocarray.c b/malloc/reallocarray.c
index 319eccd21f..32642303a3 100644
--- a/malloc/reallocarray.c
+++ b/malloc/reallocarray.c
@@ -18,19 +18,17 @@
 
 #include <errno.h>
 #include <malloc.h>
-#include <malloc/malloc-internal.h>
 
 void *
 __libc_reallocarray (void *optr, size_t nmemb, size_t elem_size)
 {
   size_t bytes;
-  if (check_mul_overflow_size_t (nmemb, elem_size, &bytes))
+  if (__builtin_mul_overflow (nmemb, elem_size, &bytes))
     {
       __set_errno (ENOMEM);
       return 0;
     }
-  else
-    return realloc (optr, bytes);
+  return realloc (optr, bytes);
 }
 libc_hidden_def (__libc_reallocarray)