nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6f4492
)
lib/core: fix segfaults in `String::realpath` and remove fixed FIXME
author
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 8 Dec 2015 15:09:34 +0000
(10:09 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 8 Dec 2015 15:09:34 +0000
(10:09 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/core/file.nit
patch
|
blob
|
history
diff --git
a/lib/core/file.nit
b/lib/core/file.nit
index
03955eb
..
fd848e1
100644
(file)
--- a/
lib/core/file.nit
+++ b/
lib/core/file.nit
@@
-959,10
+959,13
@@
redef class String
end
# Return the canonicalized absolute pathname (see POSIX function `realpath`)
+ #
+ # Require: `file_exists`
fun realpath: String do
var cs = to_cstring.file_realpath
+ assert file_exists
var res = cs.to_s_with_copy
- # cs.free_malloc # FIXME memory leak
+ cs.free
return res
end