mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
Fix some memory leaks.
* src/named-ref.c: Add a pointer check (named_ref_free). * src/scan-code.l: New function (variant_table_free). Called in code_scanner_free. * src/symlist.c: Call to named_ref_free (symbol_list_free).
This commit is contained in:
@@ -351,6 +351,15 @@ variant_table_grow ()
|
||||
return &variant_table[variant_count - 1];
|
||||
}
|
||||
|
||||
static void
|
||||
variant_table_free ()
|
||||
{
|
||||
if (variant_table)
|
||||
free (variant_table);
|
||||
variant_table = 0;
|
||||
variant_table_size = variant_count = 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
find_prefix_end (const char *prefix, char *begin, char *end)
|
||||
{
|
||||
@@ -866,6 +875,8 @@ void
|
||||
code_scanner_free (void)
|
||||
{
|
||||
obstack_free (&obstack_for_string, 0);
|
||||
variant_table_free ();
|
||||
|
||||
/* Reclaim Flex's buffers. */
|
||||
yylex_destroy ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user