comparison 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
comparison
equal deleted inserted replaced
5910:99724695f69f 5911:81f5a056b2a5
1552 char_u *buf; 1552 char_u *buf;
1553 long_u len; 1553 long_u len;
1554 1554
1555 #if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2) 1555 #if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
1556 int is_fish_shell; 1556 int is_fish_shell;
1557 char_u *shell_name = get_isolated_shell_name();
1557 1558
1558 /* Account for fish's different syntax for subshells */ 1559 /* Account for fish's different syntax for subshells */
1559 is_fish_shell = (fnamecmp(get_isolated_shell_name(), "fish") == 0); 1560 is_fish_shell = (fnamecmp(shell_name, "fish") == 0);
1561 vim_free(shell_name);
1560 if (is_fish_shell) 1562 if (is_fish_shell)
1561 len = (long_u)STRLEN(cmd) + 13; /* "begin; " + "; end" + NUL */ 1563 len = (long_u)STRLEN(cmd) + 13; /* "begin; " + "; end" + NUL */
1562 else 1564 else
1563 #endif 1565 #endif
1564 len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */ 1566 len = (long_u)STRLEN(cmd) + 3; /* "()" + NUL */