mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 01:33:03 +00:00
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:
@@ -728,6 +728,7 @@ production_step (search_state *ss, int parser_state)
|
|||||||
copy->complexity = complexity;
|
copy->complexity = complexity;
|
||||||
ssb_append (copy);
|
ssb_append (copy);
|
||||||
}
|
}
|
||||||
|
gl_list_free (prods);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
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;
|
copy->complexity += r_cost + PRODUCTION_COST + 2 * SHIFT_COST;
|
||||||
gl_list_add_last (result, copy);
|
gl_list_add_last (result, copy);
|
||||||
}
|
}
|
||||||
|
gl_list_free (reduced);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user