Close the file when done

This commit is contained in:
Dane Everitt 2020-12-25 14:01:25 -08:00
parent 0cdfdc725c
commit 31d4c1d34f
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -36,7 +36,9 @@ func (s *Server) getServerwideIgnoredFiles() (string, error) {
return "", nil
}
return "", err
} else if st.Mode()&os.ModeSymlink != 0 || st.Size() > 32*1024 {
}
defer f.Close()
if st.Mode()&os.ModeSymlink != 0 || st.Size() > 32*1024 {
// Don't read a symlinked ignore file, or a file larger than 32KiB in size.
return "", nil
}