From: Ulrich Drepper Date: Tue, 12 Oct 2010 13:00:33 +0000 (-0400) Subject: One more regex memory leak fixed. X-Git-Tag: glibc-2.13~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b833d51fbbf78b38c6ff68074c22d3fe3ddd0ce3;p=platform%2Fupstream%2Fglibc.git One more regex memory leak fixed. --- diff --git a/ChangeLog b/ChangeLog index 2192364..e2a4a70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-12 Ulrich Drepper + + [BZ #12078] + * posix/regcomp.c (parse_branch): One more memory leak plugged. + * posix/bug-regex31.input: Add test case. + 2010-10-11 Ulrich Drepper * posix/bug-regex31.c: Rewrite to run multiple tests from stdin. diff --git a/posix/bug-regex31.input b/posix/bug-regex31.input index eea961c..3d1f531 100644 --- a/posix/bug-regex31.input +++ b/posix/bug-regex31.input @@ -1,3 +1,4 @@ +[[][ ([0] ([0]a ([0]([0]) diff --git a/posix/regcomp.c b/posix/regcomp.c index 4ee7b90..b238c08 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -2160,6 +2160,8 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, exp = parse_expression (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && exp == NULL, 0)) { + if (tree != NULL) + postorder (tree, free_tree, NULL); return NULL; } if (tree != NULL && exp != NULL)