diff options
author | Bram Moolenaar <bram@vim.org> | 2014-05-22 14:00:16 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2014-05-22 14:00:16 +0200 |
commit | 4d8095c174a7bd5595289c738d0043b34c21ac7f (patch) | |
tree | 5f700efda939f92b0c7f4d19584df30c823169c5 | |
parent | 7d6577786767741d29b20f0fcb56defcf497f355 (diff) | |
download | vim-4d8095c174a7bd5595289c738d0043b34c21ac7f.tar.gz |
Problem: Memory leak from result of get_isolated_shell_name().
Solution: Free the memory. (Dominique Pelle)
-rw-r--r-- | src/ex_cmds.c | 4 | ||||
-rw-r--r-- | src/misc1.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index f52e2abc..2e5917f4 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1554,9 +1554,11 @@ make_filter_cmd(cmd, itmp, otmp) #if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2) int is_fish_shell; + char_u *shell_name = get_isolated_shell_name(); /* Account for fish's different syntax for subshells */ - is_fish_shell = (fnamecmp(get_isolated_shell_name(), "fish") == 0); + is_fish_shell = (fnamecmp(shell_name, "fish") == 0); + vim_free(shell_name); if (is_fish_shell) len = (long_u)STRLEN(cmd) + 13; /* "begin; " + "; end" + NUL */ else diff --git a/src/misc1.c b/src/misc1.c index 88ebd8da..95d18a57 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -10874,7 +10874,7 @@ goto_im() } /* - * Returns the isolated name of the shell: + * Returns the isolated name of the shell in allocated memory: * - Skip beyond any path. E.g., "/usr/bin/csh -f" -> "csh -f". * - Remove any argument. E.g., "csh -f" -> "csh". * But don't allow a space in the path, so that this works: diff --git a/src/version.c b/src/version.c index 93d21308..40e967df 100644 --- a/src/version.c +++ b/src/version.c @@ -735,6 +735,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 297, +/**/ 296, /**/ 295, |