From 866bc6a49f779b78f043a15121e194853ba8b34c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 17 May 2020 17:49:52 +0200 Subject: [PATCH] cex: fix memory leaks when there are conflicts * src/counterexample.c (production_step, reduction_step): Release memory of temporary objects. --- src/counterexample.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/counterexample.c b/src/counterexample.c index 614e95d6..497d8229 100644 --- a/src/counterexample.c +++ b/src/counterexample.c @@ -728,6 +728,7 @@ production_step (search_state *ss, int parser_state) copy->complexity = complexity; ssb_append (copy); } + gl_list_free (prods); } static inline int @@ -776,6 +777,7 @@ reduction_step (search_state *ss, const item_number *conflict_item, copy->complexity += r_cost + PRODUCTION_COST + 2 * SHIFT_COST; gl_list_add_last (result, copy); } + gl_list_free (reduced); return result; }