File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1935,7 +1935,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
1935
1935
const char * key , const char * value ,
1936
1936
const char * value_regex , int multi_replace )
1937
1937
{
1938
- int fd = -1 , in_fd ;
1938
+ int fd = -1 , in_fd = -1 ;
1939
1939
int ret ;
1940
1940
struct lock_file * lock = NULL ;
1941
1941
char * filename_buf = NULL ;
@@ -2065,6 +2065,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
2065
2065
goto out_free ;
2066
2066
}
2067
2067
close (in_fd );
2068
+ in_fd = -1 ;
2068
2069
2069
2070
if (chmod (get_lock_file_path (lock ), st .st_mode & 07777 ) < 0 ) {
2070
2071
error ("chmod on %s failed: %s" ,
@@ -2148,6 +2149,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
2148
2149
free (filename_buf );
2149
2150
if (contents )
2150
2151
munmap (contents , contents_sz );
2152
+ if (in_fd >= 0 )
2153
+ close (in_fd );
2151
2154
return ret ;
2152
2155
2153
2156
write_err_out :
You can’t perform that action at this time.
0 commit comments