From 2bcff78b424a637cf2a057ac901da34fc298094a Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 11 Jan 2013 03:00:23 +0000 Subject: [PATCH] * string.c (dispose_string): use rb_str_free for freeing string in parse.y. by Sokolov Yura https://github.com/ruby/ruby/pull/87 fix GH-87 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ parse.y | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index db2982d88f..08dc1605a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jan 11 11:59:32 2013 NARUSE, Yui + + * string.c (dispose_string): use rb_str_free for freeing string in + parse.y. by Sokolov Yura + https://github.com/ruby/ruby/pull/87 fix GH-87 + Fri Jan 11 09:56:22 2013 Shugo Maeda * insns.def (defineclass): private constants should not be accessed diff --git a/parse.y b/parse.y index 8a541a880d..cb42db7497 100644 --- a/parse.y +++ b/parse.y @@ -5948,9 +5948,7 @@ parser_regx_options(struct parser_params *parser) static void dispose_string(VALUE str) { - /* TODO: should use another API? */ - if (RBASIC(str)->flags & RSTRING_NOEMBED) - xfree(RSTRING_PTR(str)); + rb_str_free(str); rb_gc_force_recycle(str); }