1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 01:06:39 +00:00

Merge pull request #3568 from MichaelEischer/fix-local-fd-leak

local: Fix fd leak when encountering files directly inside data/
This commit is contained in:
rawtaz 2021-11-07 01:36:48 +01:00 committed by GitHub
commit 1b152a2c4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -322,6 +322,8 @@ func visitFiles(ctx context.Context, dir string, fn func(restic.FileInfo) error,
if ignoreNotADirectory {
fi, err := d.Stat()
if err != nil || !fi.IsDir() {
// ignore subsequent errors
_ = d.Close()
return err
}
}