mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Fix another memory leak in regexp compiler (BZ #17069)
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2014-06-20 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
|
[BZ #17069]
|
||||||
|
* posix/regcomp.c (parse_reg_exp): Deallocate partially
|
||||||
|
constructed tree before returning error.
|
||||||
|
* posix/bug-regexp36.c: Expand test case.
|
||||||
|
|
||||||
2014-06-20 Stefan Liebler <stli@linux.vnet.ibm.com>
|
2014-06-20 Stefan Liebler <stli@linux.vnet.ibm.com>
|
||||||
|
|
||||||
[BZ #6803]
|
[BZ #6803]
|
||||||
|
2
NEWS
2
NEWS
@ -20,7 +20,7 @@ Version 2.20
|
|||||||
16854, 16876, 16877, 16878, 16882, 16885, 16888, 16890, 16912, 16915,
|
16854, 16876, 16877, 16878, 16882, 16885, 16888, 16890, 16912, 16915,
|
||||||
16916, 16917, 16922, 16927, 16928, 16932, 16943, 16958, 16965, 16966,
|
16916, 16917, 16922, 16927, 16928, 16932, 16943, 16958, 16965, 16966,
|
||||||
16967, 16977, 16978, 16984, 16990, 16996, 17009, 17022, 17031, 17042,
|
16967, 16977, 16978, 16984, 16990, 16996, 17009, 17022, 17031, 17042,
|
||||||
17048, 17058, 17062.
|
17048, 17058, 17062, 17069.
|
||||||
|
|
||||||
* Optimized strchr implementation for AArch64. Contributed by ARM Ltd.
|
* Optimized strchr implementation for AArch64. Contributed by ARM Ltd.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Test regcomp not leaking memory on invalid repetition operator
|
/* Test regcomp not leaking memory on parse errors
|
||||||
Copyright (C) 2014 Free Software Foundation, Inc.
|
Copyright (C) 2014 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
@ -24,6 +24,6 @@ main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
regex_t r;
|
regex_t r;
|
||||||
mtrace ();
|
mtrace ();
|
||||||
regcomp (&r, "[a]\\{-2,}", 0);
|
regcomp (&r, "[a]\\|[a]\\{-2,}", 0);
|
||||||
regfree (&r);
|
regfree (&r);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
branch = parse_branch (regexp, preg, token, syntax, nest, err);
|
||||||
if (BE (*err != REG_NOERROR && branch == NULL, 0))
|
if (BE (*err != REG_NOERROR && branch == NULL, 0))
|
||||||
return NULL;
|
{
|
||||||
|
if (tree != NULL)
|
||||||
|
postorder (tree, free_tree, NULL);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
branch = NULL;
|
branch = NULL;
|
||||||
|
Reference in New Issue
Block a user