From 83c7d9df2b0fce04c9f06911d0ed21153ba29fa2 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 8 Feb 2012 13:30:04 +0000 Subject: * string.c (rb_str_modify_expand): fix memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/string/modify.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext/-test-/string') diff --git a/ext/-test-/string/modify.c b/ext/-test-/string/modify.c index a6930051b6..ddd2efd8f0 100644 --- a/ext/-test-/string/modify.c +++ b/ext/-test-/string/modify.c @@ -7,8 +7,16 @@ bug_str_modify(VALUE str) return str; } +VALUE +bug_str_modify_expand(VALUE str, VALUE expand) +{ + rb_str_modify_expand(str, NUM2LONG(expand)); + return str; +} + void Init_modify(VALUE klass) { rb_define_method(klass, "modify!", bug_str_modify, 0); + rb_define_method(klass, "modify_expand!", bug_str_modify_expand, 1); } -- cgit v1.2.3