Skip to content

Commit 12c6e1f

Browse files
authored
Merge pull request libgit2#4986 from lhchavez/realloc
Make stdalloc__reallocarray call stdalloc__realloc
2 parents 9f388e9 + 6e0dfc6 commit 12c6e1f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/stdalloc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ static void *stdalloc__reallocarray(void *ptr, size_t nelem, size_t elsize, cons
8888
{
8989
size_t newsize;
9090

91-
GIT_UNUSED(file);
92-
GIT_UNUSED(line);
91+
if (GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize))
92+
return NULL;
9393

94-
return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ?
95-
NULL : realloc(ptr, newsize);
94+
return stdalloc__realloc(ptr, newsize, file, line);
9695
}
9796

9897
static void *stdalloc__mallocarray(size_t nelem, size_t elsize, const char *file, int line)

0 commit comments

Comments
 (0)