Open vs-savchenko opened 5 years ago
Fix is to add this at parser.c line 171 (before katana_array_destroy(...output->errors)):
{
unsigned int i;
for (i = 0; i < output->errors.length; ++i)
free(output->errors.data[i]);
}
Thanks for your replay. I actually did it like this:
void katana_destroy_error(KatanaParser* parser, KatanaError* e);
void katana_destroy_error(KatanaParser* parser, KatanaError* e)
{
if ( e ) {
katana_parser_deallocate(parser, (void*) e);
}
}
line: 172 (before katana_parser_deallocate(&parser, output);)
katana_destroy_array(&parser, katana_destroy_error, &output->errors);
Error objects are allocated on the heap and are not freed when KatanaOutput object is destroyed.
Function katana_destroy_output:
...
...