Commit e3c6a1bf02227cf996a5c0da784124ddea5c1ba6

Brodie Rao 2014-01-12T23:30:06

config: handle NULL pointers passed to git_config_iterator_free() Signed-off-by: Brodie Rao <brodie@sf.io>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
 }