summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/dircache.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-04 23:35:48 +0100
committerJakob Unterwurzacher2019-01-04 23:35:48 +0100
commitc32066c5b0ae716ba43999bf808c5baa7e08edd0 (patch)
treed4c5b1c0a714671cb33d981350118e45b0dc7dfe /internal/fusefrontend/dircache.go
parent8074f12bebbaafd2c498183a914f021d32d34578 (diff)
fusefrontend: fix fd leak in dirCache
The missing break meant that we may find a second hit in the cache, Dup() a second fd, and leak the first one. Thanks @slackner for finding this.
Diffstat (limited to 'internal/fusefrontend/dircache.go')
-rw-r--r--internal/fusefrontend/dircache.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/fusefrontend/dircache.go b/internal/fusefrontend/dircache.go
index 38f0f1c..7e80ddc 100644
--- a/internal/fusefrontend/dircache.go
+++ b/internal/fusefrontend/dircache.go
@@ -122,6 +122,7 @@ func (d *dirCacheStruct) Lookup(dirRelPath string) (fd int, iv []byte) {
return -1, nil
}
iv = e.iv
+ break
}
if fd == 0 {
d.dbg("Lookup %q: miss\n", dirRelPath)