summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-08-15 15:28:32 +0200
committerJakob Unterwurzacher2020-08-15 15:28:40 +0200
commit1ea1b179c23fe37c2f2da24e70e18dfa4ca1feff (patch)
tree7cdcbca10f0c7a07983a6ff3ec80c3db4a4843f4 /internal/fusefrontend_reverse
parent35055030a13150eeb5cd2413b4597c56e60c9605 (diff)
v2api/reverse: fix two fd leaks
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/node_helpers.go1
-rw-r--r--internal/fusefrontend_reverse/rpath.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/node_helpers.go b/internal/fusefrontend_reverse/node_helpers.go
index fd0abfc..76ddd42 100644
--- a/internal/fusefrontend_reverse/node_helpers.go
+++ b/internal/fusefrontend_reverse/node_helpers.go
@@ -104,6 +104,7 @@ func (n *Node) lookupLongnameName(ctx context.Context, nameFile string, out *fus
errno = fs.ToErrno(err)
return
}
+ defer syscall.Close(fd)
diriv := pathiv.Derive(n.Path(), pathiv.PurposeDirIV)
rn := n.rootNode()
pName, cFullname, errno := rn.findLongnameParent(fd, diriv, nameFile)
diff --git a/internal/fusefrontend_reverse/rpath.go b/internal/fusefrontend_reverse/rpath.go
index d212dfc..2ac65be 100644
--- a/internal/fusefrontend_reverse/rpath.go
+++ b/internal/fusefrontend_reverse/rpath.go
@@ -56,6 +56,7 @@ func (rfs *RootNode) rDecryptName(cName string, dirIV []byte, pDir string) (pNam
if err != nil {
return "", err
}
+ defer syscall.Close(fd)
var errno syscall.Errno
pName, _, errno = rfs.findLongnameParent(fd, dirIV, cName)
if errno != 0 {