28 lines
1.0 KiB
Diff
28 lines
1.0 KiB
Diff
diff '--color=auto' -uNr mailutils-3.21.orig/libmu_sieve/sieve-gram.y mailutils-3.21/libmu_sieve/sieve-gram.y
|
|
--- mailutils-3.21.orig/libmu_sieve/sieve-gram.y 2026-07-19 12:44:14.665009953 +0200
|
|
+++ mailutils-3.21/libmu_sieve/sieve-gram.y 2026-07-19 12:45:52.637464772 +0200
|
|
@@ -34,6 +34,7 @@
|
|
|
|
static void node_list_add (struct mu_sieve_node_list *list,
|
|
struct mu_sieve_node *node);
|
|
+static void tree_free (struct mu_sieve_node **tree);
|
|
|
|
%}
|
|
|
|
@@ -74,6 +75,15 @@ static void node_list_add (struct mu_sieve_node_list *list,
|
|
%type <node> else_part
|
|
%type <node_list> list testlist elsif_branch maybe_elsif
|
|
|
|
+/* Reclaim partially built syntax trees and identifiers if error recovery
|
|
+ discards their semantic values. Values stored in the machine string and
|
|
+ argument pools remain owned by the machine and are released when it is
|
|
+ destroyed. */
|
|
+%destructor { free ($$); } IDENT
|
|
+%destructor { free ($$.ident); } <command>
|
|
+%destructor { tree_free (&$$); } <node>
|
|
+%destructor { tree_free (&$$.head); } <node_list>
|
|
+
|
|
%%
|
|
|
|
input : /* empty */
|