summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-11-05 06:55:29 -0800
committerVicent Martí <vicent@github.com>2013-11-05 06:55:29 -0800
commitae26c4b80f6d144df0e7915f72c64c5daf73ca50 (patch)
tree4f883a669b59ecd388df091739763c1bf499ce3c /src
parentc82f7f8e9954bb74b9f7eabd0e1b1ce99110dbbf (diff)
parent61080a959d5f027d3eef066bd7b771132b50496e (diff)
downloadlibgit2-ae26c4b80f6d144df0e7915f72c64c5daf73ca50.tar.gz
Merge pull request #1943 from libgit2/ntk/fix/leaks
Fix leaks
Diffstat (limited to 'src')
-rw-r--r--src/config_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 9b4a7c1b6..0bd4e4ece 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -1210,8 +1210,11 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
write_start = data_start;
/* Lock the file */
- if ((result = git_filebuf_open(&file, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0)
- return result;
+ if ((result = git_filebuf_open(
+ &file, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0) {
+ git_buf_free(&reader->buffer);
+ return result;
+ }
skip_bom(reader);
ldot = strrchr(key, '.');