diff options
author | Hannu Hartikainen <hannu.hartikainen@gmail.com> | 2017-11-20 22:20:01 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-20 21:20:01 +0100 |
commit | c39140164877ce51d5785405205a570b45cc5f82 (patch) | |
tree | 66edbf8fd0391647a2d95c78a8e3b2984bd42d96 | |
parent | 7d24a95b450c0d97706e2d92a19424d84d51015e (diff) | |
download | rneovim-c39140164877ce51d5785405205a570b45cc5f82.tar.gz rneovim-c39140164877ce51d5785405205a570b45cc5f82.tar.bz2 rneovim-c39140164877ce51d5785405205a570b45cc5f82.zip |
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`.
-rw-r--r-- | src/nvim/ex_cmds.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 39059a2c80..8616508d88 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -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; } |