summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-07-27 12:21:42 -0700
committerJunio C Hamano <gitster@pobox.com>2015-07-27 12:21:42 -0700
commit6f402a93ce1eb00438c5bcc5f28164d9165ba8b9 (patch)
treecc065acda84eca837b1afe55b6898a0e357e7af9
parent726359be47b194c692990d3047d23ac56142a220 (diff)
parent7a64592cf8cc559d6043500b8e77d1fed07c5ec2 (diff)
downloadgit-6f402a93ce1eb00438c5bcc5f28164d9165ba8b9.tar.gz
Merge branch 'kb/config-unmap-before-renaming' into maint
"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
-rw-r--r--config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.c b/config.c
index 27a73c8500..69824ebddb 100644
--- a/config.c
+++ b/config.c
@@ -2116,6 +2116,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) {