forked from TrueCloudLab/restic
local: Fix fd leak when encountering files directly inside data/
This commit is contained in:
parent
6c84ea1412
commit
15d7313387
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue