From b833d51fbbf78b38c6ff68074c22d3fe3ddd0ce3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 12 Oct 2010 09:00:33 -0400 Subject: One more regex memory leak fixed. --- posix/bug-regex31.input | 1 + posix/regcomp.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'posix') diff --git a/posix/bug-regex31.input b/posix/bug-regex31.input index eea961ccf5..3d1f531f4e 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 4ee7b90ace..b238c08225 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) -- cgit v1.2.3