Skip to content

Commit 313f523

Browse files
committed
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
2 parents d790ba9 + 7a64592 commit 313f523

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
@@ -2118,6 +2118,9 @@ int git_config_set_multivar_in_file(const char *config_filename,
21182118
contents_sz - copy_begin) <
21192119
contents_sz - copy_begin)
21202120
goto write_err_out;
2121+
2122+
munmap(contents, contents_sz);
2123+
contents = NULL;
21212124
}
21222125

21232126
if (commit_lock_file(lock) < 0) {

0 commit comments

Comments
 (0)