summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-13 22:12:17 +0100
committerArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-13 22:17:07 +0100
commita8e4cb11fd77d52529e1e464df52a6db1aae33e7 (patch)
tree450e2e244eab7f6f6bfd836a9302e7c11fb2af7b /src/config_file.c
parent1234738e06c806ebafaf0ec04523adc823999c2d (diff)
downloadlibgit2-a8e4cb11fd77d52529e1e464df52a6db1aae33e7.tar.gz
Fix a memory leak in `config_parse`.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 2e78f7c8b..c7727c029 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -1072,8 +1072,10 @@ static int config_parse(diskfile_backend *cfg_file, struct reader *reader, git_c
git_buf_printf(&buf, "%s.%s", current_section, var_name);
git__free(var_name);
- if (git_buf_oom(&buf))
+ if (git_buf_oom(&buf)) {
+ git__free(var_value);
return -1;
+ }
var->entry->name = git_buf_detach(&buf);
var->entry->value = var_value;