Commit c24130e06896e9838a05301079bdb8f09912e546

Linquize 2014-01-18T22:58:31

Fix segfault when calling git_config_get_* functions when a config fails to load Reinitialize the result code of get_entry() to GIT_ENOTFOUND

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/config.c b/src/config.c
index 056a6ae..6dcaba5 100644
--- a/src/config.c
+++ b/src/config.c
@@ -651,6 +651,7 @@ static int get_entry(
 		key = normalized;
 	}
 
+	res = GIT_ENOTFOUND;
 	git_vector_foreach(&cfg->files, i, internal) {
 		if (!internal || !internal->file)
 			continue;