Commit 505f37b41a7d80c539a33d28aec947cd87bb1b6c

Vicent Marti 2012-10-25T19:22:35

config: Only dereference value on success

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/config.c b/src/config.c
index f9bd205..c85695f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -400,7 +400,7 @@ static int get_string_at_file(const char **out, git_config_file *file, const cha
 	*out = NULL;
 
 	res = file->get(file, name, &entry);
-	if (res != GIT_ENOTFOUND)
+	if (!res)
 		*out = entry->value;
 
 	return res;