diff --git a/ChangeLog b/ChangeLog index 94275232..afca4bb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-12-29 Akim Demaille + + 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 * src/options.h, src/options.c (create_long_option_table): Rename diff --git a/src/LR0.c b/src/LR0.c index 3f06fedf..e914c6ef 100644 --- a/src/LR0.c +++ b/src/LR0.c @@ -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)