mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 02:40:05 +00:00
Fix memory leak in os.get_current_directory on failure on *nix systems
This commit is contained in:
@@ -823,6 +823,7 @@ get_current_directory :: proc() -> string {
|
||||
return strings.string_from_nul_terminated_ptr(&buf[0], len(buf))
|
||||
}
|
||||
if _get_errno(res) != ERANGE {
|
||||
delete(buf)
|
||||
return ""
|
||||
}
|
||||
resize(&buf, len(buf)+page_size)
|
||||
|
||||
Reference in New Issue
Block a user