aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/os/file_other.go
diff options
context:
space:
mode:
authorAchille Roussel <[email protected]>2023-02-09 15:52:50 -0800
committerRon Evans <[email protected]>2023-03-28 13:12:21 +0200
commit85da9a0aacca150113ef600949d53df7d079a3f3 (patch)
treeace65581676cf69cdaef7a35fb9a1a53bdbf664d /src/os/file_other.go
parent17bc0d6663776259494ceb50e83ea9db84328053 (diff)
downloadtinygo-85da9a0aacca150113ef600949d53df7d079a3f3.tar.gz
tinygo-85da9a0aacca150113ef600949d53df7d079a3f3.zip
fix resource leak in os.(*File).Close
Signed-off-by: Achille Roussel <[email protected]>
Diffstat (limited to 'src/os/file_other.go')
-rw-r--r--src/os/file_other.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/os/file_other.go b/src/os/file_other.go
index 12b21b838..7e4642c0b 100644
--- a/src/os/file_other.go
+++ b/src/os/file_other.go
@@ -33,6 +33,10 @@ type file struct {
name string
}
+func (f *file) close() error {
+ return f.handle.Close()
+}
+
func NewFile(fd uintptr, name string) *File {
return &File{&file{stdioFileHandle(fd), name}}
}