mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
compress: fix memory leak - fixes #6013
Before this change we forgot to close the compressor when checking to see if an object was compressible.
This commit is contained in:
parent
21355b4208
commit
e0fbca02d4
@ -401,6 +401,10 @@ func isCompressible(r io.Reader) (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
ratio := float64(n) / float64(b.Len())
|
||||
return ratio > minCompressionRatio, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user