1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-24 08:12:38 +02:00

fix: close file (#1274)

This commit is contained in:
guoguangwu 2024-06-12 23:17:57 +08:00 committed by GitHub
parent e4bf5e93fb
commit 27d9ebad38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,6 +66,7 @@ func StringSliceFile(s *[]string, filepath string) error {
if err != nil { if err != nil {
return fmt.Errorf("Can't open file %s\n", filepath) return fmt.Errorf("Can't open file %s\n", filepath)
} }
defer f.Close()
scanner := bufio.NewScanner(f) scanner := bufio.NewScanner(f)
for scanner.Scan() { for scanner.Scan() {