mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
* 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:
parent
06fa07662b
commit
b1bf026f48
2 changed files with 7 additions and 2 deletions
|
@ -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;\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue