diff --git a/ChangeLog b/ChangeLog index 6995808990..389f1714c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Sep 12 20:00:22 2008 Yusuke Endoh + + * regparse.c (parse_exp): fix resource leak. + Fri Sep 12 01:21:22 2008 Yusuke Endoh * ext/syck/node.c (syck_replace_str2): fix wrong check to free ptr. diff --git a/regparse.c b/regparse.c index 3d2c57a25a..168b175758 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; }