parser: fix regex parser leak on parsing failure

When the regex parser failed, the Chars objects created/used in rules
charset and cset_chars would not be cleaned up properly and would
leak.

Closes #361

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2023-11-23 17:37:46 -03:00
parent 9bba464d93
commit dcad01ccc3

View file

@ -72,6 +72,7 @@ static inline Chars* insert_char_range(Chars* cset, transchar a, transchar b)
* parsing succeeds!
*/
%destructor { $$->release(); } expr terms0 terms qterm term
%destructor { delete $$; } charset cset_chars
%%