diff --git a/hosts.go b/hosts.go index 1a1d83c..8357754 100644 --- a/hosts.go +++ b/hosts.go @@ -109,6 +109,7 @@ func (f *FileHosts) Refresh() { if err != nil { panic("Can't open " + f.file) } + defer buf.Close() scanner := bufio.NewScanner(buf) for scanner.Scan() {