mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(treesitter): free memory on removing parser (#19933)
This fixes the ASAN failure.
This commit is contained in:
parent
c545d514df
commit
6b9ff5491d
@ -216,7 +216,9 @@ int tslua_remove_lang(lua_State *L)
|
||||
const char *lang_name = luaL_checkstring(L, 1);
|
||||
bool present = pmap_has(cstr_t)(&langs, lang_name);
|
||||
if (present) {
|
||||
char *key = (char *)pmap_key(cstr_t)(&langs, lang_name);
|
||||
pmap_del(cstr_t)(&langs, lang_name);
|
||||
xfree(key);
|
||||
}
|
||||
lua_pushboolean(L, present);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user