Commit 1234738e06c806ebafaf0ec04523adc823999c2d

Arthur Schreiber 2014-01-13T22:12:02

Fix a memory leak in `git_config_iterator_glob_new`.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/config.c b/src/config.c
index b8d78c2..8447608 100644
--- a/src/config.c
+++ b/src/config.c
@@ -458,6 +458,7 @@ int git_config_iterator_glob_new(git_config_iterator **out, const git_config *cf
 	if ((result = regcomp(&iter->regex, regexp, REG_EXTENDED)) < 0) {
 		giterr_set_regex(&iter->regex, result);
 		regfree(&iter->regex);
+		git__free(iter);
 		return -1;
 	}