os: fix a memory leak in File.write(string)

pull/1301/head
Alexander Medvednikov 2019-07-24 22:47:06 +02:00
parent d2b33397cc
commit 299d41e3b9
1 changed files with 1 additions and 3 deletions

View File

@ -263,9 +263,7 @@ pub fn open_append(path string) ?File {
} }
pub fn (f File) write(s string) { pub fn (f File) write(s string) {
ss := s.clone() // TODO is clone() needed here? C.fputs(s.str, f.cfile)
C.fputs(ss.str, f.cfile)
// ss.free()
// C.fwrite(s.str, 1, s.len, f.cfile) // C.fwrite(s.str, 1, s.len, f.cfile)
} }