summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/emalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp/libntp/emalloc.c')
-rw-r--r--contrib/ntp/libntp/emalloc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/ntp/libntp/emalloc.c b/contrib/ntp/libntp/emalloc.c
index 8b7ef99..7746b7a 100644
--- a/contrib/ntp/libntp/emalloc.c
+++ b/contrib/ntp/libntp/emalloc.c
@@ -83,10 +83,11 @@ ereallocz(
#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
void *
-oreallocarray(
+oreallocarrayxz(
void *optr,
size_t nmemb,
- size_t size
+ size_t size,
+ size_t extra
#ifdef EREALLOC_CALLSITE /* ntp_malloc.h */
,
const char * file,
@@ -106,9 +107,9 @@ oreallocarray(
exit(1);
}
#ifndef EREALLOC_CALLSITE
- return ereallocz(optr, (size * nmemb), 0, FALSE);
+ return ereallocz(optr, extra + (size * nmemb), 0, TRUE);
#else
- return ereallocz(optr, (size * nmemb), 0, FALSE, file, line);
+ return ereallocz(optr, extra + (size * nmemb), 0, TRUE, file, line);
#endif
}
OpenPOWER on IntegriCloud