diff --git a/ChangeLog b/ChangeLog index c08b060138..0119c9a8f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 6 00:34:50 2010 Yusuke Endoh + + * vm.c (thread_free): free altstack to prevent memory leak. a patch + from Tomoyuki Chikanaga in [ruby-dev:41815]. [Bug #3537] + Tue Jul 6 00:29:27 2010 Yusuke Endoh * string.c (NONASCII_MASK): NONASCII_MASK must be unsigned. diff --git a/vm.c b/vm.c index dd5de1f4b7..8e93963a39 100644 --- a/vm.c +++ b/vm.c @@ -1726,6 +1726,11 @@ thread_free(void *ptr) RUBY_GC_INFO("main thread\n"); } else { +#ifdef USE_SIGALTSTACK + if (th->altstack) { + free(th->altstack); + } +#endif ruby_xfree(ptr); } }