diff src/ex_cmds.c @ 5911:81f5a056b2a5 v7.4.297

updated for version 7.4.297 Problem: Memory leak from result of get_isolated_shell_name(). Solution: Free the memory. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Thu, 22 May 2014 14:00:16 +0200
parents aa99d04fa7e2
children 7b3248267575
line wrap: on
line diff
--- 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