From 7b7356f04cd9d293e0b545d21b26e692afadc2a5 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 9 Nov 2022 20:20:11 +0800 Subject: [PATCH] close the reader under disk cache bitrot verification (#16024) --- cmd/disk-cache-backend.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/disk-cache-backend.go b/cmd/disk-cache-backend.go index b9ff603ea..dce5578ec 100644 --- a/cmd/disk-cache-backend.go +++ b/cmd/disk-cache-backend.go @@ -1003,6 +1003,7 @@ func (c *diskCache) bitrotReadFromCache(ctx context.Context, filePath string, of if err != nil { return err } + defer rc.Close() bufp := c.pool.Get().(*[]byte) defer c.pool.Put(bufp)