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