From c32066c5b0ae716ba43999bf808c5baa7e08edd0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 4 Jan 2019 23:35:48 +0100 Subject: [PATCH] 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. --- internal/fusefrontend/dircache.go | 1 + 1 file changed, 1 insertion(+) 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)