cex: fix memory leaks when there are conflicts

* src/counterexample.c (production_step, reduction_step): Release
memory of temporary objects.
This commit is contained in:
Akim Demaille
2020-05-17 17:49:52 +02:00
parent e8619330e8
commit 866bc6a49f

View File

@@ -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;
}