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) {