Skip to content

Commit 6f402a9

Browse files
committed
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
2 parents 726359b + 7a64592 commit 6f402a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,6 +2116,9 @@ int git_config_set_multivar_in_file(const char *config_filename,
21162116
contents_sz - copy_begin) <
21172117
contents_sz - copy_begin)
21182118
goto write_err_out;
2119+
2120+
munmap(contents, contents_sz);
2121+
contents = NULL;
21192122
}
21202123

21212124
if (commit_lock_file(lock) < 0) {

0 commit comments

Comments
 (0)