Merge pull request #1938 from panicinc/merge/parse-cancel-pointer-crash
Resolving a crash when freeing a null pointer when cancelling parses
This commit is contained in:
commit
757c032455
1 changed files with 3 additions and 1 deletions
|
|
@ -1461,7 +1461,9 @@ static bool ts_parser__advance(
|
|||
((self->cancellation_flag && atomic_load(self->cancellation_flag)) ||
|
||||
(!clock_is_null(self->end_clock) && clock_is_gt(clock_now(), self->end_clock)))
|
||||
) {
|
||||
ts_subtree_release(&self->tree_pool, lookahead);
|
||||
if (lookahead.ptr) {
|
||||
ts_subtree_release(&self->tree_pool, lookahead);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue