mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix a memory leak in File.write(string)
This commit is contained in:
parent
d2b33397cc
commit
299d41e3b9
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user