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 @@ -1954,7 +1954,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
1954
1954
const char * key , const char * value ,
1955
1955
const char * value_regex , int multi_replace )
1956
1956
{
1957
- int fd = -1 , in_fd ;
1957
+ int fd = -1 , in_fd = -1 ;
1958
1958
int ret ;
1959
1959
struct lock_file * lock = NULL ;
1960
1960
char * filename_buf = NULL ;
@@ -2084,6 +2084,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
2084
2084
goto out_free ;
2085
2085
}
2086
2086
close (in_fd );
2087
+ in_fd = -1 ;
2087
2088
2088
2089
if (chmod (lock -> filename .buf , st .st_mode & 07777 ) < 0 ) {
2089
2090
error ("chmod on %s failed: %s" ,
@@ -2167,6 +2168,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
2167
2168
free (filename_buf );
2168
2169
if (contents )
2169
2170
munmap (contents , contents_sz );
2171
+ if (in_fd >= 0 )
2172
+ close (in_fd );
2170
2173
return ret ;
2171
2174
2172
2175
write_err_out :
You can’t perform that action at this time.
0 commit comments