summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/fd_map.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/kernel/fd_map.go')
-rw-r--r--pkg/sentry/kernel/fd_map.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/fd_map.go b/pkg/sentry/kernel/fd_map.go
index 786936a7d..1b84bfe14 100644
--- a/pkg/sentry/kernel/fd_map.go
+++ b/pkg/sentry/kernel/fd_map.go
@@ -98,11 +98,13 @@ func (f *FDMap) ID() uint64 {
// NewFDMap allocates a new FDMap that may be used by tasks in k.
func (k *Kernel) NewFDMap() *FDMap {
- return &FDMap{
+ f := FDMap{
k: k,
files: make(map[kdefs.FD]descriptor),
uid: atomic.AddUint64(&k.fdMapUids, 1),
}
+ f.EnableLeakCheck("kernel.FDMap")
+ return &f
}
// destroy removes all of the file descriptors from the map.