cex: fix lssi leaks

* src/lssi.c (shortest_path_from_start): Free the root of
shortest_path_from_start search.
Free eligible bitset.
This commit is contained in:
Vincent Imbimbo
2020-05-21 22:13:13 -04:00
committed by Akim Demaille
parent 150b2318ed
commit b5e0351c3e

View File

@@ -159,9 +159,9 @@ shortest_path_from_start (state_item_number target, symbol_number next_sym)
bitset il = bitset_create (nsyms, BITSET_FIXED); bitset il = bitset_create (nsyms, BITSET_FIXED);
bitset_set (il, 0); bitset_set (il, 0);
lssi *init = new_lssi (0, NULL, il, true); lssi *init = new_lssi (0, NULL, il, true);
gl_list_t queue = gl_list_create (GL_LINKED_LIST, NULL, NULL, gl_list_t queue = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL,
NULL, NULL, true);
true, 1, (const void **) &init); append_lssi (init, visited, queue);
// breadth-first search // breadth-first search
bool finished = false; bool finished = false;
lssi *n; lssi *n;
@@ -234,6 +234,8 @@ shortest_path_from_start (state_item_number target, symbol_number next_sym)
bitset_free (lookahead); bitset_free (lookahead);
} }
} }
bitset_free (eligible);
if (!finished) if (!finished)
{ {
gl_list_free (queue); gl_list_free (queue);