publisher: Close file when done
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 11 Aug 2018 18:19:07 +0000 (20:19 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 11 Aug 2018 18:19:07 +0000 (20:19 +0200)
Fixes #5062

publisher/publisher.go

index be4472791c5300b88f6b7e484c245829f74b6af9..de9b03d0d9d6e07980e1174c262d2ee1300d8eaa 100644 (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 {