40 lines
1.5 KiB
Diff
40 lines
1.5 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 */
|
|
diff '--color=auto' -uNr mailutils-3.21.orig/libmu_sieve/prog.c mailutils-3.21/libmu_sieve/prog.c
|
|
--- mailutils-3.21.orig/libmu_sieve/prog.c 2025-12-28 14:09:52.000000000 +0100
|
|
+++ mailutils-3.21/libmu_sieve/prog.c 2026-07-19 13:15:00.000000000 +0200
|
|
@@ -316,6 +316,8 @@ mu_i_sv_lint_command (struct mu_sieve_ma
|
|
chk_arg.node = node;
|
|
err = mu_list_foreach (chk_list, _run_checker, &chk_arg);
|
|
}
|
|
+
|
|
+ mu_list_destroy (&chk_list);
|
|
}
|
|
|
|
static void
|