summaryrefslogtreecommitdiff
path: root/regparse.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-12 11:02:21 (GMT)
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-12 11:02:21 (GMT)
commiteca8de632c8e6ba7a5f96f4e1bf53a12556e1cc6 (patch)
tree80cf936f90548d47e8ec491d16555e82da18c0f3 /regparse.c
parentd1724ecbd206091602c480081c91a7e90b54e4bf (diff)
* regparse.c (parse_exp): fix resource leak.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/regparse.c b/regparse.c
index 3d2c57a..168b175 100644
--- a/regparse.c
+++ b/regparse.c
@@ -5387,7 +5387,10 @@ parse_exp(Node** np, OnigToken* tok, int term,
if (tok->u.repeat.possessive != 0) {
Node* en;
en = node_new_enclose(ENCLOSE_STOP_BACKTRACK);
- CHECK_NULL_RETURN_MEMERR(en);
+ if (IS_NULL(en)) {
+ onig_node_free(qn);
+ return ONIGERR_MEMORY;
+ }
NENCLOSE(en)->target = qn;
qn = en;
}