mirror of https://github.com/restic/restic.git
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:
commit
1b152a2c4d
|
@ -322,6 +322,8 @@ func visitFiles(ctx context.Context, dir string, fn func(restic.FileInfo) error,
|
||||||
if ignoreNotADirectory {
|
if ignoreNotADirectory {
|
||||||
fi, err := d.Stat()
|
fi, err := d.Stat()
|
||||||
if err != nil || !fi.IsDir() {
|
if err != nil || !fi.IsDir() {
|
||||||
|
// ignore subsequent errors
|
||||||
|
_ = d.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue