From aa6ec754f3b4b1df81d186480c534b6486a1e6ee Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 20 Jun 2014 12:41:27 +0200 Subject: Fix another memory leak in regexp compiler (BZ #17069) --- posix/regcomp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'posix/regcomp.c') diff --git a/posix/regcomp.c b/posix/regcomp.c index a5020be192..076eca3e7c 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -2154,7 +2154,11 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, { branch = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && branch == NULL, 0)) - return NULL; + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } } else branch = NULL; -- cgit v1.2.1