diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-19 06:51:19 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-19 06:51:19 +0000 |
commit | 2dae3d23d20a4d94b17ad4c479fcd12dba22ac7d (patch) | |
tree | ed38aeadf8d65565839d0180addcfeab29e38ec4 | |
parent | 6cef092f68e7c1f147c64c4462b025f3ffddeed5 (diff) |
merge revision(s) 25181:
* io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks.
fixed: #2009 [ruby-core:25173] [ruby-dev:39410]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | io.c | 8 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Thu Nov 19 15:34:40 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks. + fixed: #2009 [ruby-core:25173] [ruby-dev:39410] + Thu Nov 19 15:27:17 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca> * lib/net/http.rb (transport_request): Handle timeout error by @@ -2334,10 +2334,10 @@ rb_io_fptr_finalize(fptr) if (fptr->path) { free(fptr->path); } - if (!fptr->f && !fptr->f2) return; - if (fileno(fptr->f) < 3) return; - - rb_io_fptr_cleanup(fptr, Qtrue); + if ((fptr->f && fileno(fptr->f) > 2) || fptr->f2) { + rb_io_fptr_cleanup(fptr, Qtrue); + } + xfree(fptr); } VALUE @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2009-11-19" #define RUBY_VERSION_CODE 187 #define RUBY_RELEASE_CODE 20091119 -#define RUBY_PATCHLEVEL 213 +#define RUBY_PATCHLEVEL 214 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |