Problem reported by Anastasia Belova in:
https://sourceware.org/pipermail/libc-alpha/2025-June/168231.html
* lib/regcomp.c (parse_bracket_exp): Avoid double-free
when storage allocation fails in create_token_tree.
+2025-06-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ regex: fix parse_bracket_exp double-free
+ Problem reported by Anastasia Belova in:
+ https://sourceware.org/pipermail/libc-alpha/2025-June/168231.html
+ * lib/regcomp.c (parse_bracket_exp): Avoid double-free
+ when storage allocation fails in create_token_tree.
+
2025-06-25 Bruno Haible <bruno@clisp.org>
kwset: Add tests.
else
{
free_charset (mbcset);
+ mbcset = NULL;
/* Build a tree for simple bracket. */
br_token.type = SIMPLE_BRACKET;
br_token.opr.sbcset = sbcset;
*err = REG_ESPACE;
parse_bracket_exp_free_return:
re_free (sbcset);
- free_charset (mbcset);
+ if (__glibc_likely (mbcset != NULL))
+ free_charset (mbcset);
return NULL;
}