summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/vfs2/memfd.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-08-05 16:14:40 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-05 16:16:32 -0700
commit1403a88c67ccc87af383f5e54fd2f77c673eebe7 (patch)
treea92598967967a11ca646d681921821b2d714b541 /pkg/sentry/syscalls/linux/vfs2/memfd.go
parente7b232a5b881c8930db968a7709ebd93cb2cab04 (diff)
Release extra memfd reference.
PiperOrigin-RevId: 325122849
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2/memfd.go')
-rw-r--r--pkg/sentry/syscalls/linux/vfs2/memfd.go1
1 files changed, 1 insertions, 0 deletions
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,