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,
19541954 const char * key , const char * value ,
19551955 const char * value_regex , int multi_replace )
19561956{
1957- int fd = -1 , in_fd ;
1957+ int fd = -1 , in_fd = -1 ;
19581958 int ret ;
19591959 struct lock_file * lock = NULL ;
19601960 char * filename_buf = NULL ;
@@ -2084,6 +2084,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
20842084 goto out_free ;
20852085 }
20862086 close (in_fd );
2087+ in_fd = -1 ;
20872088
20882089 if (chmod (lock -> filename .buf , st .st_mode & 07777 ) < 0 ) {
20892090 error ("chmod on %s failed: %s" ,
@@ -2167,6 +2168,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
21672168 free (filename_buf );
21682169 if (contents )
21692170 munmap (contents , contents_sz );
2171+ if (in_fd >= 0 )
2172+ close (in_fd );
21702173 return ret ;
21712174
21722175write_err_out :
You can’t perform that action at this time.
0 commit comments