* src/treesit.c (treesit_load_language): Fix a memory leak.
Reported by Eric Gillespie <epg@pretzelnet.org>.
eassume (handle != NULL);
dynlib_error ();
TSLanguage *(*langfn) (void);
- char *c_name = xstrdup (SSDATA (base_name));
- treesit_symbol_to_c_name (c_name);
+ char *c_name;
if (found_override)
c_name = xstrdup (SSDATA (override_c_name));
+ else
+ {
+ c_name = xstrdup (SSDATA (base_name));
+ treesit_symbol_to_c_name (c_name);
+ }
langfn = dynlib_sym (handle, c_name);
xfree (c_name);
error = dynlib_error ();