fusefrontend: openBackingDir: fix fd leak in error path

Reported by @slackner at
932efbd459 (r31813373)
thanks!
This commit is contained in:
Jakob Unterwurzacher 2019-01-02 00:14:12 +01:00
parent d99a0480f7
commit 5aa1755cbc
1 changed files with 1 additions and 0 deletions

View File

@ -65,6 +65,7 @@ func (fs *FS) openBackingDir(relPath string) (dirfd int, cName string, err error
for i, name := range parts {
iv, err := nametransform.ReadDirIVAt(dirfd)
if err != nil {
syscall.Close(dirfd)
return -1, "", err
}
cName = fs.nameTransform.EncryptAndHashName(name, iv)