Fix memory leaks

This commit is contained in:
Max Brunsfeld 2014-06-09 13:02:39 -07:00
parent 9bc7d51074
commit 12331d66f5
7 changed files with 24 additions and 14 deletions

View file

@ -13,6 +13,10 @@ ts_document * ts_document_make() {
}
void ts_document_free(ts_document *document) {
if (document->parser.free_fn)
document->parser.free_fn(document->parser.data);
if (document->input.release_fn)
document->input.release_fn(document->input.data);
free(document);
}