Mingw: verify both ends of the pipe () call
[gitweb.git] / config.c
index 29fa0121d583d3a77fcc2e8319cc484c317dcca3..9fd275f2c2a46a0f8f5a78db49ba2c6f5635f32f 100644 (file)
--- 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) {