mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
helptags: fix double-free (#7600)
closes #7599 Helped-by: oni-link <knil.ino@gmail.com> Freeing `dirname` was first introduced by a code refactoring from `ex_helptags()` to `do_helptags()` (`vim-patch:7.4.1551`)(#4648) and later removed by `vim-patch:7.4.1562`(#4660). Only problem with that is, that the patches were not applied in order so the fixing patch was declared `N/A`. So `do_helptags()` should have never freed `dirname`.
This commit is contained in:
parent
7d24a95b45
commit
c391401648
@ -5292,7 +5292,6 @@ static void do_helptags(char_u *dirname, bool add_help_tags)
|
||||
if (!add_pathsep((char *)NameBuff)
|
||||
|| STRLCAT(NameBuff, "**", sizeof(NameBuff)) >= MAXPATHL) {
|
||||
EMSG(_(e_fnametoolong));
|
||||
xfree(dirname);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -5303,7 +5302,6 @@ static void do_helptags(char_u *dirname, bool add_help_tags)
|
||||
EW_FILE|EW_SILENT) == FAIL
|
||||
|| filecount == 0) {
|
||||
EMSG2(_("E151: No match: %s"), NameBuff);
|
||||
xfree(dirname);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user