libedit: fix use after free

This commit is contained in:
Baptiste Daroussin committed 2026-03-05 17:13:08 +01:00
1 parent 80b4129bef
commit 6d2a147ae5
1 file changed
+2 -2
+2 -2
View File
@@ -962,12 +962,12 @@ map_end(EditLine *el)
el->el_map.emacs = NULL;
el->el_map.vic = NULL;
el->el_map.vii = NULL;
el_free(el->el_map.help);
el->el_map.help = NULL;
for (size_t nf = EL_NUM_FCNS; nf < el->el_map.nfunc; nf++) {
el_free((void *)(intptr_t)el->el_map.help[nf].name);
el_free((void *)(intptr_t)el->el_map.help[nf].description);
}
el_free(el->el_map.help);
el->el_map.help = NULL;
el_free(el->el_map.func);
el->el_map.func = NULL;
}