mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
Fix segfault when deleting tree-sitter query (bug#72238)
* src/treesit.c (treesit_delete_query): Only delete query and cursor when they are non-NULL.
This commit is contained in:
parent
ccb856189f
commit
4868a17396
@ -1224,8 +1224,10 @@ treesit_delete_parser (struct Lisp_TS_Parser *lisp_parser)
|
||||
void
|
||||
treesit_delete_query (struct Lisp_TS_Query *lisp_query)
|
||||
{
|
||||
ts_query_delete (lisp_query->query);
|
||||
ts_query_cursor_delete (lisp_query->cursor);
|
||||
if (lisp_query->query)
|
||||
ts_query_delete (lisp_query->query);
|
||||
if (lisp_query->cursor)
|
||||
ts_query_cursor_delete (lisp_query->cursor);
|
||||
}
|
||||
|
||||
/* The following function is called from print.c:print_vectorlike. */
|
||||
|
Loading…
Reference in New Issue
Block a user