diff options
author | Jakob Unterwurzacher | 2019-01-02 00:14:12 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-01-02 00:14:12 +0100 |
commit | 5aa1755cbc55d17a5b4b71faa1e0bba34fe83d8b (patch) | |
tree | 1e5bc3b9f29e97357f1d96c2426dda6641e7119a /internal/fusefrontend/names.go | |
parent | d99a0480f712d4fd1c2012c57a9e1c938d70c9fe (diff) |
fusefrontend: openBackingDir: fix fd leak in error path
Reported by @slackner at
https://github.com/rfjakob/gocryptfs/commit/932efbd4593fe6be6c86f0dafeaea32910b7c246#r31813373
thanks!
Diffstat (limited to 'internal/fusefrontend/names.go')
-rw-r--r-- | internal/fusefrontend/names.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/fusefrontend/names.go b/internal/fusefrontend/names.go index a6791cc..36185e2 100644 --- a/internal/fusefrontend/names.go +++ b/internal/fusefrontend/names.go @@ -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) |