Commit 2fcc0d07 by Brodie Rao

util: handle NULL pointers passed to git_strarray_free()

Signed-off-by: Brodie Rao <brodie@sf.io>
parent 2ad45213
......@@ -140,6 +140,10 @@ int git_libgit2_opts(int key, ...)
void git_strarray_free(git_strarray *array)
{
size_t i;
if (array == NULL)
return;
for (i = 0; i < array->count; ++i)
git__free(array->strings[i]);
......
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