util: handle NULL pointers passed to git_strarray_free()

Signed-off-by: Brodie Rao <brodie@sf.io>
This commit is contained in:
Brodie Rao 2014-01-12 23:32:10 -08:00
parent 2ad45213a8
commit 2fcc0d07d0

View File

@ -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]);