summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/fs_context.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2019-06-28 20:06:33 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-28 20:07:52 -0700
commit45566fa4e4bc55e870ae1d7f80778be8432bdef5 (patch)
tree9b9064ef22a6f34ade4714cc90ad0573440c3e1c /pkg/sentry/kernel/fs_context.go
parent7dae043fecc109d7a0ae1d5d6274e48b1bf04d13 (diff)
Add finalizer on AtomicRefCount to check for leaks.
PiperOrigin-RevId: 255711454
Diffstat (limited to 'pkg/sentry/kernel/fs_context.go')
-rw-r--r--pkg/sentry/kernel/fs_context.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/fs_context.go b/pkg/sentry/kernel/fs_context.go
index 938239aeb..ded27d668 100644
--- a/pkg/sentry/kernel/fs_context.go
+++ b/pkg/sentry/kernel/fs_context.go
@@ -51,11 +51,13 @@ type FSContext struct {
func newFSContext(root, cwd *fs.Dirent, umask uint) *FSContext {
root.IncRef()
cwd.IncRef()
- return &FSContext{
+ f := FSContext{
root: root,
cwd: cwd,
umask: umask,
}
+ f.EnableLeakCheck("kernel.FSContext")
+ return &f
}
// destroy is the destructor for an FSContext.