v2api/reverse: fix two fd leaks
This commit is contained in:
parent
35055030a1
commit
1ea1b179c2
|
@ -104,6 +104,7 @@ func (n *Node) lookupLongnameName(ctx context.Context, nameFile string, out *fus
|
||||||
errno = fs.ToErrno(err)
|
errno = fs.ToErrno(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer syscall.Close(fd)
|
||||||
diriv := pathiv.Derive(n.Path(), pathiv.PurposeDirIV)
|
diriv := pathiv.Derive(n.Path(), pathiv.PurposeDirIV)
|
||||||
rn := n.rootNode()
|
rn := n.rootNode()
|
||||||
pName, cFullname, errno := rn.findLongnameParent(fd, diriv, nameFile)
|
pName, cFullname, errno := rn.findLongnameParent(fd, diriv, nameFile)
|
||||||
|
|
|
@ -56,6 +56,7 @@ func (rfs *RootNode) rDecryptName(cName string, dirIV []byte, pDir string) (pNam
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
defer syscall.Close(fd)
|
||||||
var errno syscall.Errno
|
var errno syscall.Errno
|
||||||
pName, _, errno = rfs.findLongnameParent(fd, dirIV, cName)
|
pName, _, errno = rfs.findLongnameParent(fd, dirIV, cName)
|
||||||
if errno != 0 {
|
if errno != 0 {
|
||||||
|
|
Loading…
Reference in New Issue