ruby-changes:6750
From: mame <ko1@a...>
Date: Wed, 30 Jul 2008 21:30:44 +0900 (JST)
Subject: [ruby-changes:6750] Ruby:r18266 (trunk): * regparse.c (parse_exp): fix memory leak.
mame 2008-07-30 21:30:28 +0900 (Wed, 30 Jul 2008) New Revision: 18266 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18266 Log: * regparse.c (parse_exp): fix memory leak. Modified files: trunk/ChangeLog trunk/regparse.c Index: regparse.c =================================================================== --- regparse.c (revision 18265) +++ regparse.c (revision 18266) @@ -729,7 +729,10 @@ CHECK_NULL_RETURN_MEMERR(e); e->name = strdup_with_null(reg->enc, name, name_end); - if (IS_NULL(e->name)) return ONIGERR_MEMORY; + if (IS_NULL(e->name)) { + xfree(e); + return ONIGERR_MEMORY; + } onig_st_insert_strend(t, e->name, (e->name + (name_end - name)), (HashDataType )e); Index: ChangeLog =================================================================== --- ChangeLog (revision 18265) +++ ChangeLog (revision 18266) @@ -1,3 +1,7 @@ +Wed Jul 30 21:30:08 2008 Yusuke Endoh <mame@t...> + + * regparse.c (parse_exp): fix memory leak. + Wed Jul 30 21:08:06 2008 Yusuke Endoh <mame@t...> * regparse.c (parse_exp): fix memory leak at Regexp.new("x{1,1}"). -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/