summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-07-13 14:00:27 -0700
committerJunio C Hamano <gitster@pobox.com>2015-07-13 14:00:27 -0700
commit313f52334b2b2b40ab0cedadaf081203de4284d7 (patch)
treea663c48426c9a6864ec046b3909462a8f1c7454f /config.c
parentd790ba92cc534127fc4c0d58a901d1553835aa62 (diff)
parent7a64592cf8cc559d6043500b8e77d1fed07c5ec2 (diff)
downloadgit-313f52334b2b2b40ab0cedadaf081203de4284d7.tar.gz
Merge branch 'kb/config-unmap-before-renaming'
"git config" failed to update the configuration file when the underlying filesystem is incapable of renaming a file that is still open. * kb/config-unmap-before-renaming: config.c: fix writing config files on Windows network shares
Diffstat (limited to 'config.c')
-rw-r--r--config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.c b/config.c
index 29fa0121d5..9fd275f2c2 100644
--- a/config.c
+++ b/config.c
@@ -2118,6 +2118,9 @@ int git_config_set_multivar_in_file(const char *config_filename,
contents_sz - copy_begin) <
contents_sz - copy_begin)
goto write_err_out;
+
+ munmap(contents, contents_sz);
+ contents = NULL;
}
if (commit_lock_file(lock) < 0) {