vector: do not realloc 0-size vectors
diff --git a/src/vector.c b/src/vector.c
index aac4863..98aa7bb 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -32,6 +32,9 @@ GIT_INLINE(int) resize_vector(git_vector *v, size_t new_size)
{
void *new_contents;
+ if (new_size == 0)
+ return 0;
+
new_contents = git__reallocarray(v->contents, new_size, sizeof(void *));
GITERR_CHECK_ALLOC(new_contents);