Problem: Memory leak from result of get_isolated_shell_name().
Solution: Free the memory. (Dominique Pelle)
#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
}
/*
- * 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:
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 297,
/**/
296,
/**/