Commit e0afd1c2 by Etienne Samson

vector: do not realloc 0-size vectors

parent fa48d2ea
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment