Skip to content

Commit

Permalink
Fix html parser leak
Browse files Browse the repository at this point in the history
  • Loading branch information
zyc9012 committed Sep 4, 2024
1 parent 26f4906 commit 91190f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/nokolexbor/nl_document.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ nl_document_parse(VALUE self, VALUE rb_string_or_io)
html_parser = lxb_html_parser_create();
lxb_status_t status = lxb_html_parser_init(html_parser);
if (status != LXB_STATUS_OK) {
lxb_html_parser_destroy(html_parser);
html_parser = NULL;
nl_raise_lexbor_error(status);
}
html_parser->tree->scripting = true;
Expand Down

0 comments on commit 91190f2

Please sign in to comment.