summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-08 13:30:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-08 13:30:04 +0000
commit4e39dc864cc197923bf6e56b9359a1c4def7b1ae (patch)
tree23207320fc8686084ac145a122a217875fcc00cc /ext
parent9a57bc8f55116d02c8294dcb4ebcddcfd56a006f (diff)
* string.c (rb_str_modify_expand): fix memory leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/string/modify.c8
1 files changed, 8 insertions, 0 deletions
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);
}