Fix double free
authorLukas Jiriste <ljiriste@student.42prague.com>
Sun, 7 Jul 2024 07:18:47 +0000 (09:18 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Sun, 21 Jul 2024 18:21:21 +0000 (20:21 +0200)
commitd29fb2c45ea265da7890c962ab6f4d5f9773af40
tree302299f2c55560e7f436c2b87da11736f68b51c4
parent03ccf7f1bf05d6da74452e152ff23895708460c7
Fix double free

Because the goto_tokens used tokens from table instead of their copies
and were freed when generator states were cleared, the table tokens
then contained pointers to freed memory which were to be used.

There are two ways to fix this. Either not free the tokens in
goto_tokens or append copies. I opted for the latter because every part
of the generator code uses copies too. It may be rewritten to use the
table tokens later on to save memory.
ft_parse/ft_parsing_table_generate.c