summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/dirent_cache.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2020-03-06 12:30:37 -0800
committergVisor bot <gvisor-bot@google.com>2020-03-06 12:31:43 -0800
commit6fa5cee82c0f515b001dee5f3840e1f875b2f477 (patch)
treeadec65de9c23995348e898b3e52077edabf3b0c9 /pkg/sentry/fs/dirent_cache.go
parent18d41cf15368c4d091ffdf84da655994eb1a1099 (diff)
Prevent memory leaks in ilist
When list elements are removed from a list but not discarded, it becomes important to invalidate the references they hold to their former neighbors to prevent memory leaks. PiperOrigin-RevId: 299412421
Diffstat (limited to 'pkg/sentry/fs/dirent_cache.go')
-rw-r--r--pkg/sentry/fs/dirent_cache.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/pkg/sentry/fs/dirent_cache.go b/pkg/sentry/fs/dirent_cache.go
index 25514ace4..33de32c69 100644
--- a/pkg/sentry/fs/dirent_cache.go
+++ b/pkg/sentry/fs/dirent_cache.go
@@ -101,8 +101,6 @@ func (c *DirentCache) remove(d *Dirent) {
panic(fmt.Sprintf("trying to remove %v, which is not in the dirent cache", d))
}
c.list.Remove(d)
- d.SetPrev(nil)
- d.SetNext(nil)
d.DecRef()
c.currentSize--
if c.limit != nil {