config: handle NULL pointers passed to git_config_iterator_free() Signed-off-by: Brodie Rao <brodie@sf.io>
diff --git a/src/config.c b/src/config.c
index 056a6ae..b8d78c2 100644
--- a/src/config.c
+++ b/src/config.c
@@ -927,6 +927,9 @@ int git_config_next(git_config_entry **entry, git_config_iterator *iter)
void git_config_iterator_free(git_config_iterator *iter)
{
+ if (iter == NULL)
+ return;
+
iter->free(iter);
}