* chan is leaked

* Remove path.Clean

Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
This commit is contained in:
mattn
2021-10-16 16:51:09 +09:00
committed by GitHub
parent 6ab75b30e5
commit e5455d9713
2 changed files with 5 additions and 4 deletions

View File

@ -57,6 +57,7 @@ func (s *Server) scanHandler(w http.ResponseWriter, r *http.Request) {
c := clamd.NewClamd(s.ClamAVDaemonHost)
abort := make(chan bool)
defer close(abort)
response, err := c.ScanStream(reader, abort)
if err != nil {
s.logger.Printf("%s", err.Error())
@ -70,6 +71,4 @@ func (s *Server) scanHandler(w http.ResponseWriter, r *http.Request) {
case <-time.After(time.Second * 60):
abort <- true
}
close(abort)
}