diff options
author | Andrei Vagin <avagin@google.com> | 2019-05-03 14:00:31 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-05-03 14:01:50 -0700 |
commit | 24d8656585e6072ff7d5a00a7eb4bd25cba42dc4 (patch) | |
tree | e0d737c80086ca1fba007ca9d6c7dacdbdaba6de /runsc/fsgofer | |
parent | f2699b76c89a5be1ef6411f29a57b4cccc59fa17 (diff) |
gofer: don't leak file descriptors
Fixes #219
PiperOrigin-RevId: 246568639
Change-Id: Ic7afd15dde922638d77f6429c508d1cbe2e4288a
Diffstat (limited to 'runsc/fsgofer')
-rw-r--r-- | runsc/fsgofer/fsgofer.go | 3 |
1 files changed, 3 insertions, 0 deletions
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) } |