mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
cex: fix leaks
* src/state-item.c: Various functions were using heap allocated locals and not freeing them.
This commit is contained in:
committed by
Akim Demaille
parent
4590071287
commit
2d8c3edbf8
@@ -73,6 +73,7 @@ hash_pair_lookup (Hash_table *tab, int key)
|
|||||||
hash_pair *hp = (hash_pair *) hash_lookup (tab, l);
|
hash_pair *hp = (hash_pair *) hash_lookup (tab, l);
|
||||||
if (!hp)
|
if (!hp)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
free (l);
|
||||||
return hp->l;
|
return hp->l;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +175,7 @@ init_state_items (void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
state_item_map[nstates] = nstate_items;
|
state_item_map[nstates] = nstate_items;
|
||||||
|
bitsetv_free (production_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
@@ -193,7 +195,9 @@ state_sym_lookup (symbol_number sym, Hash_table *h)
|
|||||||
{
|
{
|
||||||
state *s = xmalloc (sizeof (state));
|
state *s = xmalloc (sizeof (state));
|
||||||
s->accessing_symbol = sym;
|
s->accessing_symbol = sym;
|
||||||
return hash_lookup (h, s);
|
state *res = hash_lookup (h, s);
|
||||||
|
free (s);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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);
|
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_add_first (queue, &state_items[sin]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
gl_list_free (queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user