From 24d8656585e6072ff7d5a00a7eb4bd25cba42dc4 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 3 May 2019 14:00:31 -0700 Subject: gofer: don't leak file descriptors Fixes #219 PiperOrigin-RevId: 246568639 Change-Id: Ic7afd15dde922638d77f6429c508d1cbe2e4288a --- runsc/fsgofer/fsgofer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runsc/fsgofer/fsgofer.go') diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index 158f22ddc..3a0806837 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -502,6 +502,9 @@ func (l *localFile) Walk(names []string) ([]p9.QID, p9.File, error) { last := l for _, name := range names { f, path, err := openAnyFileFromParent(last, name) + if last != l { + last.Close() + } if err != nil { return nil, nil, extractErrno(err) } -- cgit v1.2.3