Fix memory leak in os.get_current_directory on failure on *nix systems
This commit is contained in:
1 parent
7416f72565
commit
b6ca10cd5e
4 files changed
+4
No files matched your search
@@ -701,6 +701,7 @@ get_current_directory :: proc() -> string {
|
||||
return string(cwd)
|
||||
}
|
||||
if Errno(get_last_error()) != ERANGE {
|
||||
delete(buf)
|
||||
return ""
|
||||
}
|
||||
resize(&buf, len(buf)+page_size)
|
||||
|
||||
Reference in new issue
Block a user