publisher: Close file when done

Fixes #5062
This commit is contained in:
Bjørn Erik Pedersen 2018-08-11 20:19:07 +02:00
parent 2182ecfd34
commit f6ae436c58
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -108,6 +108,7 @@ func (p DestinationPublisher) Publish(d Descriptor) error {
if err != nil {
return err
}
defer f.Close()
_, err = io.Copy(f, src)
if err == nil && d.StatCounter != nil {