mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
It is undefined behaviour to free environ as it is managed by the system. This caused RUBY_FREE_AT_EXIT to double free on systems like Linux. This commit changes it to only free orig_environ, which is enough to make both Valgrind and macOS leaks tools to not detect memory leaks.