Fix path (#416)
* chan is leaked * Remove path.Clean Co-authored-by: Andrea Spacca <andrea.spacca@gmail.com>
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user