From 1403a88c67ccc87af383f5e54fd2f77c673eebe7 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Wed, 5 Aug 2020 16:14:40 -0700 Subject: Release extra memfd reference. PiperOrigin-RevId: 325122849 --- pkg/sentry/syscalls/linux/vfs2/memfd.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/sentry/syscalls/linux/vfs2/memfd.go b/pkg/sentry/syscalls/linux/vfs2/memfd.go index 519583e4e..c4c0f9e0a 100644 --- a/pkg/sentry/syscalls/linux/vfs2/memfd.go +++ b/pkg/sentry/syscalls/linux/vfs2/memfd.go @@ -51,6 +51,7 @@ func MemfdCreate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S if err != nil { return 0, nil, err } + defer file.DecRef(t) fd, err := t.NewFDFromVFS2(0, file, kernel.FDFlags{ CloseOnExec: cloExec, -- cgit v1.2.3