summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorLinquize <linquize@yahoo.com.hk>2014-01-18 22:58:31 +0800
committerLinquize <linquize@yahoo.com.hk>2014-01-18 22:58:31 +0800
commitc24130e06896e9838a05301079bdb8f09912e546 (patch)
tree2803c3066db81c3f3cfdf98785854708540c4613 /src/config.c
parentf3a302ad8e961f0180d37693ca6de4b65c3ffc81 (diff)
downloadlibgit2-c24130e06896e9838a05301079bdb8f09912e546.tar.gz
Fix segfault when calling git_config_get_* functions when a config fails to load
Reinitialize the result code of get_entry() to GIT_ENOTFOUND
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 056a6ae13..6dcaba5fd 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;