]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.297 v7.4.297
authorBram Moolenaar <Bram@vim.org>
Thu, 22 May 2014 12:00:16 +0000 (14:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 May 2014 12:00:16 +0000 (14:00 +0200)
Problem:    Memory leak from result of get_isolated_shell_name().
Solution:   Free the memory. (Dominique Pelle)

src/ex_cmds.c
src/misc1.c
src/version.c

index f52e2abcd56877400591cf8f0f3c5d2ff145c9ee..2e5917f4a28b804e8e8dfc89d26080a1f6146935 100644 (file)
@@ -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
index 88ebd8da39d30162fa8f4bccf5b25593d3df5075..95d18a571fb4eb80d8ac4df9d326431b3425fdc7 100644 (file)
@@ -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:
index 93d213088592570f02cefde0fcb4624b5bd15624..40e967dfe5e296a66ed67adc564aac7bcd3909c4 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    297,
 /**/
     296,
 /**/