config: Only dereference value on success
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;