From c9ba05af8dfabca00023bd2312dec4ec59497801 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 7 Feb 2023 21:53:05 +0200 Subject: [PATCH] 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) --- src/treesit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 (); -- 2.39.5