From: Eli Zaretskii Date: Tue, 7 Feb 2023 19:53:05 +0000 (+0200) Subject: Fix crashes inside 'xfree' called from treesit.c X-Git-Tag: emacs-29.0.90~473 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c9ba05af8df;p=emacs.git Fix crashes inside 'xfree' called from treesit.c * src/treesit.c (treesit_load_language): Always xstrdup 'c_name', to avoid crashes inside xfree. (Bug#61351) --- diff --git a/src/treesit.c b/src/treesit.c index 8e772523cc7..b15d44fca01 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -620,7 +620,7 @@ treesit_load_language (Lisp_Object language_symbol, char *c_name = xstrdup (SSDATA (base_name)); treesit_symbol_to_c_name (c_name); if (found_override) - c_name = SSDATA (override_c_name); + c_name = xstrdup (SSDATA (override_c_name)); langfn = dynlib_sym (handle, c_name); xfree (c_name); error = dynlib_error ();