diff options
author | Vincent Imbimbo <vmi6@cornell.edu> | 2020-05-17 09:59:39 -0400 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-05-22 08:45:43 +0200 |
commit | 2d8c3edbf8b25c02fbdac1c3b251f3c98fb8bdcd (patch) | |
tree | e1be2d98404bf5310e66a839d8e624bdfb07c024 /src/state-item.c | |
parent | 459007128745be28bcde5ff78d3912fa0dd2b257 (diff) | |
download | bison-2d8c3edbf8b25c02fbdac1c3b251f3c98fb8bdcd.tar.gz |
cex: fix leaks
* src/state-item.c: Various functions were using heap allocated locals
and not freeing them.
Diffstat (limited to 'src/state-item.c')
-rw-r--r-- | src/state-item.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/state-item.c b/src/state-item.c index 82496956..4a09e035 100644 --- a/src/state-item.c +++ b/src/state-item.c @@ -73,6 +73,7 @@ hash_pair_lookup (Hash_table *tab, int key) hash_pair *hp = (hash_pair *) hash_lookup (tab, l); if (!hp) return NULL; + free (l); return hp->l; } @@ -174,6 +175,7 @@ init_state_items (void) } state_item_map[nstates] = nstate_items; + bitsetv_free (production_items); } static size_t @@ -193,7 +195,9 @@ state_sym_lookup (symbol_number sym, Hash_table *h) { state *s = xmalloc (sizeof (state)); s->accessing_symbol = sym; - return hash_lookup (h, s); + state *res = hash_lookup (h, s); + free (s); + return res; } static void @@ -234,6 +238,7 @@ init_trans (void) } } } + free (transition_set); } } @@ -306,7 +311,7 @@ init_prods (void) bitset_set (si_revs[prod], j); } } - + free (closure_map); } } @@ -345,6 +350,7 @@ gen_lookaheads (void) gl_list_add_first (queue, &state_items[sin]); } } + gl_list_free (queue); } } |