forked from TrueCloudLab/restic
cache: Fix file descriptor leak in TestBackendRemoveBroken
This commit is contained in:
parent
9ec7eee803
commit
430ab32941
1 changed files with 3 additions and 0 deletions
3
internal/cache/backend_test.go
vendored
3
internal/cache/backend_test.go
vendored
|
@ -199,6 +199,9 @@ func TestBackendRemoveBroken(t *testing.T) {
|
|||
|
||||
// check that the cache now contains the correct data
|
||||
rd, err := c.load(h, 0, 0)
|
||||
defer func() {
|
||||
_ = rd.Close()
|
||||
}()
|
||||
test.OK(t, err)
|
||||
cached, err := ioutil.ReadAll(rd)
|
||||
test.OK(t, err)
|
||||
|
|
Loading…
Reference in a new issue