diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-16 02:45:35 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-16 02:45:35 +0000 |
commit | 7680ca8d2612a6a5e452f616e271ef3c02bec3f6 (patch) | |
tree | 3e16fa966413ac05f9f75cd65bb45106dd1d8485 | |
parent | 2d6dad4f4f9cca79764289d6b1e61392dccc7e89 (diff) |
* ext/syck/rubyext.c (syck_resolver_tagurize): fixed memory leak.
* ext/syck/rubyext.c (syck_node_type_id_set): should set newly
allocated memory instead of RString's internal storage.
... these fixes won't fix [ruby-dev:27839]. more work is needed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | ext/syck/rubyext.c | 14 |
2 files changed, 20 insertions, 8 deletions
@@ -1,3 +1,12 @@ +Fri Dec 16 11:44:43 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> + + * ext/syck/rubyext.c (syck_resolver_tagurize): fixed memory leak. + + * ext/syck/rubyext.c (syck_node_type_id_set): should set newly + allocated memory instead of RString's internal storage. + + ... these fixes won't fix [ruby-dev:27839]. more work is needed. + Thu Dec 15 12:35:14 2005 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/tmpdir.rb: merged RDoc patch from Eric Hodel <drbrain at @@ -146,7 +155,7 @@ Tue Dec 6 16:48:40 2005 Yukihiro Matsumoto <matz@ruby-lang.org> * gc.c (ruby_xrealloc2): ditto. -Tue Dec 4 16:37:57 2005 Yuya Nishida <yuya@j96.org> +Tue Dec 6 16:37:57 2005 Yuya Nishida <yuya@j96.org> * eval.c (exec_under): avoid accessing ruby_frame->prev. [ruby-dev:27948] @@ -2988,7 +2997,8 @@ Sat Jul 30 18:49:44 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp> * ext/win32ole/tests/testOLETYPE.rb: ditto. -Fri Jul 29 16:12:02 005 Keiju Ishitsuka <keiju@ruby-lang.org> +Fri Jul 29 16:12:02 2005 Keiju Ishitsuka <keiju@ruby-lang.org> + * lib/irb/context.rb: fix `irb --readline` option. [ruby-dev:40955] Fri Jul 29 09:59:38 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c index cf183dab52..e45d4971f2 100644 --- a/ext/syck/rubyext.c +++ b/ext/syck/rubyext.c @@ -1191,10 +1191,9 @@ syck_resolver_tagurize( self, val ) if ( !NIL_P(tmp) ) { - char *taguri; - val = tmp; - taguri = syck_type_id_to_uri( RSTRING(val)->ptr ); - return rb_str_new2( taguri ); + char *taguri = syck_type_id_to_uri( RSTRING(tmp)->ptr ); + val = rb_str_new2( taguri ); + S_FREE( taguri ); } return val; @@ -1405,7 +1404,9 @@ syck_node_mark( n ) } break; } - rb_gc_mark_maybe( n->shortcut ); +#if 0 /* maybe needed */ + if ( n->shortcut ) syck_node_mark( n->shortcut ); /* caution: maybe cyclic */ +#endif } /* @@ -1795,7 +1796,8 @@ syck_node_type_id_set( self, type_id ) if ( NIL_P( type_id ) ) { node->type_id = NULL; } else { - node->type_id = StringValuePtr( type_id ); + StringValue( type_id ); + node->type_id = syck_strndup( RSTRING(type_id)->ptr, RSTRING(type_id)->len ); } rb_iv_set( self, "@type_id", type_id ); |