* src/treesit.c (treesit_load_language): Use 'xstrdup'/'xfree'
instead of 'strdup'/'free', to prevent crashes on MS-Windows,
where we must use our own implementation of 'malloc'/'free',
whereas 'strdup' uses the default implementation in the MS-Windows
C runtime library.
/* Load TSLanguage. */
dynlib_error ();
TSLanguage *(*langfn) (void);
- char *c_name = strdup (SSDATA (base_name));
+ char *c_name = xstrdup (SSDATA (base_name));
treesit_symbol_to_c_name (c_name);
if (found_override)
c_name = SSDATA (override_c_name);
langfn = dynlib_sym (handle, c_name);
- free (c_name);
+ xfree (c_name);
error = dynlib_error ();
if (error != NULL)
{