os: fix a leak in read_lines()
parent
57b30507fa
commit
a53aaaf9e7
|
@ -80,7 +80,9 @@ pub fn mv_by_cp(source string, target string) ? {
|
|||
// read_lines reads the file in `path` into an array of lines.
|
||||
pub fn read_lines(path string) ?[]string {
|
||||
buf := read_file(path) ?
|
||||
return buf.split_into_lines()
|
||||
res := buf.split_into_lines()
|
||||
unsafe { buf.free() }
|
||||
return res
|
||||
}
|
||||
|
||||
// read_ulines reads the file in `path` into an array of ustring lines.
|
||||
|
|
Loading…
Reference in New Issue