mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
Fix memory leak in os.get_current_directory on failure on *nix systems
This commit is contained in:
@@ -649,6 +649,7 @@ get_current_directory :: proc() -> string {
|
||||
return string(cwd)
|
||||
}
|
||||
if Errno(get_last_error()) != ERANGE {
|
||||
delete(buf)
|
||||
return ""
|
||||
}
|
||||
resize(&buf, len(buf) + MAX_PATH)
|
||||
|
||||
Reference in New Issue
Block a user