summaryrefslogtreecommitdiff
path: root/src/stdalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdalloc.c')
-rw-r--r--src/stdalloc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/stdalloc.c b/src/stdalloc.c
index c6d4ec80c..c4938e32b 100644
--- a/src/stdalloc.c
+++ b/src/stdalloc.c
@@ -88,11 +88,10 @@ static void *stdalloc__reallocarray(void *ptr, size_t nelem, size_t elsize, cons
{
size_t newsize;
- GIT_UNUSED(file);
- GIT_UNUSED(line);
+ if (GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize))
+ return NULL;
- return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ?
- NULL : realloc(ptr, newsize);
+ return stdalloc__realloc(ptr, newsize, file, line);
}
static void *stdalloc__mallocarray(size_t nelem, size_t elsize, const char *file, int line)