From c39140164877ce51d5785405205a570b45cc5f82 Mon Sep 17 00:00:00 2001 From: Hannu Hartikainen Date: Mon, 20 Nov 2017 22:20:01 +0200 Subject: helptags: fix double-free (#7600) closes #7599 Helped-by: oni-link 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`. --- src/nvim/ex_cmds.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') 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; } -- cgit