summaryrefslogtreecommitdiff
path: root/src/vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.c')
-rw-r--r--src/vector.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/vector.c b/src/vector.c
index b636032b1..27eafebc8 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -29,14 +29,9 @@ GIT_INLINE(size_t) compute_new_size(git_vector *v)
GIT_INLINE(int) resize_vector(git_vector *v, size_t new_size)
{
- size_t new_bytes;
void *new_contents;
- /* Check for overflow */
- GITERR_CHECK_ALLOC_MULTIPLY(new_size, sizeof(void *));
- new_bytes = new_size * sizeof(void *);
-
- new_contents = git__realloc(v->contents, new_bytes);
+ new_contents = git__reallocarray(v->contents, new_size, sizeof(void *));
GITERR_CHECK_ALLOC(new_contents);
v->_alloc_size = new_size;