lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
ff700db
To: vim_dev@googlegroups.com
ff700db
Subject: Patch 7.4.297
ff700db
Fcc: outbox
ff700db
From: Bram Moolenaar <Bram@moolenaar.net>
ff700db
Mime-Version: 1.0
ff700db
Content-Type: text/plain; charset=UTF-8
ff700db
Content-Transfer-Encoding: 8bit
ff700db
------------
ff700db
ff700db
Patch 7.4.297
ff700db
Problem:    Memory leak from result of get_isolated_shell_name().
ff700db
Solution:   Free the memory. (Dominique Pelle)
ff700db
Files:	    src/ex_cmds.c, src/misc1.c
ff700db
ff700db
ff700db
*** ../vim-7.4.296/src/ex_cmds.c	2014-05-09 20:33:01.098790466 +0200
ff700db
--- src/ex_cmds.c	2014-05-22 13:59:20.962535763 +0200
ff700db
***************
ff700db
*** 1554,1562 ****
ff700db
  
ff700db
  #if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
ff700db
      int		is_fish_shell;
ff700db
  
ff700db
      /* Account for fish's different syntax for subshells */
ff700db
!     is_fish_shell = (fnamecmp(get_isolated_shell_name(), "fish") == 0);
ff700db
      if (is_fish_shell)
ff700db
  	len = (long_u)STRLEN(cmd) + 13;		/* "begin; " + "; end" + NUL */
ff700db
      else
ff700db
--- 1554,1564 ----
ff700db
  
ff700db
  #if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
ff700db
      int		is_fish_shell;
ff700db
+     char_u	*shell_name = get_isolated_shell_name();
ff700db
  
ff700db
      /* Account for fish's different syntax for subshells */
ff700db
!     is_fish_shell = (fnamecmp(shell_name, "fish") == 0);
ff700db
!     vim_free(shell_name);
ff700db
      if (is_fish_shell)
ff700db
  	len = (long_u)STRLEN(cmd) + 13;		/* "begin; " + "; end" + NUL */
ff700db
      else
ff700db
*** ../vim-7.4.296/src/misc1.c	2014-05-13 12:44:19.897569605 +0200
ff700db
--- src/misc1.c	2014-05-22 13:58:52.254536347 +0200
ff700db
***************
ff700db
*** 10874,10880 ****
ff700db
  }
ff700db
  
ff700db
  /*
ff700db
!  * Returns the isolated name of the shell:
ff700db
   * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
ff700db
   * - Remove any argument.  E.g., "csh -f" -> "csh".
ff700db
   * But don't allow a space in the path, so that this works:
ff700db
--- 10874,10880 ----
ff700db
  }
ff700db
  
ff700db
  /*
ff700db
!  * Returns the isolated name of the shell in allocated memory:
ff700db
   * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
ff700db
   * - Remove any argument.  E.g., "csh -f" -> "csh".
ff700db
   * But don't allow a space in the path, so that this works:
ff700db
*** ../vim-7.4.296/src/version.c	2014-05-22 13:12:25.650592983 +0200
ff700db
--- src/version.c	2014-05-22 13:57:37.346537869 +0200
ff700db
***************
ff700db
*** 736,737 ****
ff700db
--- 736,739 ----
ff700db
  {   /* Add new patch number below this line */
ff700db
+ /**/
ff700db
+     297,
ff700db
  /**/
ff700db
ff700db
-- 
ff700db
A computer program does what you tell it to do, not what you want it to do.
ff700db
ff700db
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
ff700db
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
ff700db
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
ff700db
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///