* include/ruby/io.h (MakeOpenFile): finalize fptr get rid of

memory leak.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-03-13 03:26:18 +00:00
parent 06fa07662b
commit b1bf026f48
2 changed files with 7 additions and 2 deletions

View file

@ -101,7 +101,7 @@ typedef struct rb_io_t {
#define MakeOpenFile(obj, fp) do {\
if (RFILE(obj)->fptr) {\
rb_io_close(obj);\
free(RFILE(obj)->fptr);\
rb_io_fptr_finalize(RFILE(obj)->fptr);\
RFILE(obj)->fptr = 0;\
}\
fp = 0;\