diff --git a/ChangeLog b/ChangeLog index 0bb2f1eb23..b80165670d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 1 11:07:43 2011 KOSAKI Motohiro + + * thread.c (do_select): fix memory leak. + Patch by Eric Wong. Thank you! [Bug #4953] [ruby-core:37702] + Fri Jul 1 08:21:28 2011 Koichi Sasada * vm_insnhelper.c (vm_getivar): check vm state version diff --git a/thread.c b/thread.c index 9e869069fc..3ef587b33f 100644 --- a/thread.c +++ b/thread.c @@ -2620,6 +2620,14 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, break; } } + + if (read) + rb_fd_term(&orig_read); + if (write) + rb_fd_term(&orig_write); + if (except) + rb_fd_term(&orig_except); + return result; }