Memory leak.

* src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
since it allocates it for each state, although only one is needed.
(allocate_storage): Do it here.
This commit is contained in:
Akim Demaille
2001-12-29 14:21:23 +00:00
parent f51cb8ff8c
commit 375d580671
2 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,12 @@
2001-12-29 Akim Demaille <akim@epita.fr>
Memory leak.
* src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
since it allocates it for each state, although only one is needed.
(allocate_storage): Do it here.
2001-12-29 Akim Demaille <akim@epita.fr>
* src/options.h, src/options.c (create_long_option_table): Rename

View File

@@ -113,6 +113,7 @@ allocate_storage (void)
shiftset = XCALLOC (short, nsyms);
redset = XCALLOC (short, nrules + 1);
state_hash = XCALLOC (state_t *, STATE_HASH_SIZE);
shift_symbol = XCALLOC (short, nsyms);
}
@@ -154,7 +155,6 @@ new_itemsets (void)
for (i = 0; i < nsyms; i++)
kernel_size[i] = 0;
shift_symbol = XCALLOC (short, nsyms);
nshifts = 0;
for (i = 0; i < nitemset; ++i)