summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-05 20:54:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-05 20:54:52 +0000
commit37a483a884b789911fbaf46c640ed9a3346ff2d2 (patch)
tree1088fe7634631c816680250ed7018680a6ae7295 /re.c
parent214a3aa34ef90c0222e20762021437e710dd16e4 (diff)
* re.c (rb_reg_search): need to free allocated buffer in re_register. [ruby-core:17518]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@17902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/re.c b/re.c
index 6cada9a..5553d28 100644
--- a/re.c
+++ b/re.c
@@ -927,6 +927,7 @@ rb_reg_search(re, str, pos, reverse)
}
if (result < 0) {
+ re_free_registers(&regs);
rb_backref_set(Qnil);
return result;
}
@@ -943,6 +944,7 @@ rb_reg_search(re, str, pos, reverse)
}
re_copy_registers(RMATCH(match)->regs, &regs);
+ re_free_registers(&regs);
RMATCH(match)->str = rb_str_new4(str);
rb_backref_set(match);