File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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,
19351935 const char * key , const char * value ,
19361936 const char * value_regex , int multi_replace )
19371937{
1938- int fd = -1 , in_fd ;
1938+ int fd = -1 , in_fd = -1 ;
19391939 int ret ;
19401940 struct lock_file * lock = NULL ;
19411941 char * filename_buf = NULL ;
@@ -2065,6 +2065,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
20652065 goto out_free ;
20662066 }
20672067 close (in_fd );
2068+ in_fd = -1 ;
20682069
20692070 if (chmod (get_lock_file_path (lock ), st .st_mode & 07777 ) < 0 ) {
20702071 error ("chmod on %s failed: %s" ,
@@ -2148,6 +2149,8 @@ int git_config_set_multivar_in_file(const char *config_filename,
21482149 free (filename_buf );
21492150 if (contents )
21502151 munmap (contents , contents_sz );
2152+ if (in_fd >= 0 )
2153+ close (in_fd );
21512154 return ret ;
21522155
21532156write_err_out :
You can’t perform that action at this time.
0 commit comments