Karsten Hopp ac36d0
To: vim-dev@vim.org
Karsten Hopp ac36d0
Subject: Patch 7.1.166
Karsten Hopp ac36d0
Fcc: outbox
Karsten Hopp ac36d0
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp ac36d0
Mime-Version: 1.0
Karsten Hopp ac36d0
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp ac36d0
Content-Transfer-Encoding: 8bit
Karsten Hopp ac36d0
------------
Karsten Hopp ac36d0
Karsten Hopp ac36d0
Patch 7.1.166
Karsten Hopp ac36d0
Problem:    Memory leak for using "gp" in Visual mode.
Karsten Hopp ac36d0
Solution:   Free memory in put_register(). (Dominique Pelle)
Karsten Hopp ac36d0
Files:	    src/ops.c
Karsten Hopp ac36d0
Karsten Hopp ac36d0
Karsten Hopp ac36d0
*** ../vim-7.1.165/src/ops.c	Thu Nov  8 10:35:02 2007
Karsten Hopp ac36d0
--- src/ops.c	Sun Nov 25 15:17:43 2007
Karsten Hopp ac36d0
***************
Karsten Hopp ac36d0
*** 927,934 ****
Karsten Hopp ac36d0
      int		name;
Karsten Hopp ac36d0
      int		copy;	/* make a copy, if FALSE make register empty. */
Karsten Hopp ac36d0
  {
Karsten Hopp ac36d0
!     static struct yankreg	*reg;
Karsten Hopp ac36d0
!     int				i;
Karsten Hopp ac36d0
  
Karsten Hopp ac36d0
  #ifdef FEAT_CLIPBOARD
Karsten Hopp ac36d0
      /* When Visual area changed, may have to update selection.  Obtain the
Karsten Hopp ac36d0
--- 927,934 ----
Karsten Hopp ac36d0
      int		name;
Karsten Hopp ac36d0
      int		copy;	/* make a copy, if FALSE make register empty. */
Karsten Hopp ac36d0
  {
Karsten Hopp ac36d0
!     struct yankreg	*reg;
Karsten Hopp ac36d0
!     int			i;
Karsten Hopp ac36d0
  
Karsten Hopp ac36d0
  #ifdef FEAT_CLIPBOARD
Karsten Hopp ac36d0
      /* When Visual area changed, may have to update selection.  Obtain the
Karsten Hopp ac36d0
***************
Karsten Hopp ac36d0
*** 967,973 ****
Karsten Hopp ac36d0
  }
Karsten Hopp ac36d0
  
Karsten Hopp ac36d0
  /*
Karsten Hopp ac36d0
!  * Put "reg" into register "name".  Free any previous contents.
Karsten Hopp ac36d0
   */
Karsten Hopp ac36d0
      void
Karsten Hopp ac36d0
  put_register(name, reg)
Karsten Hopp ac36d0
--- 967,973 ----
Karsten Hopp ac36d0
  }
Karsten Hopp ac36d0
  
Karsten Hopp ac36d0
  /*
Karsten Hopp ac36d0
!  * Put "reg" into register "name".  Free any previous contents and "reg".
Karsten Hopp ac36d0
   */
Karsten Hopp ac36d0
      void
Karsten Hopp ac36d0
  put_register(name, reg)
Karsten Hopp ac36d0
***************
Karsten Hopp ac36d0
*** 977,982 ****
Karsten Hopp ac36d0
--- 977,983 ----
Karsten Hopp ac36d0
      get_yank_register(name, 0);
Karsten Hopp ac36d0
      free_yank_all();
Karsten Hopp ac36d0
      *y_current = *(struct yankreg *)reg;
Karsten Hopp ac36d0
+     vim_free(reg);
Karsten Hopp ac36d0
  
Karsten Hopp ac36d0
  # ifdef FEAT_CLIPBOARD
Karsten Hopp ac36d0
      /* Send text written to clipboard register to the clipboard. */
Karsten Hopp ac36d0
*** ../vim-7.1.165/src/version.c	Sat Dec  1 17:18:45 2007
Karsten Hopp ac36d0
--- src/version.c	Sat Dec  1 21:11:25 2007
Karsten Hopp ac36d0
***************
Karsten Hopp ac36d0
*** 668,669 ****
Karsten Hopp ac36d0
--- 668,671 ----
Karsten Hopp ac36d0
  {   /* Add new patch number below this line */
Karsten Hopp ac36d0
+ /**/
Karsten Hopp ac36d0
+     166,
Karsten Hopp ac36d0
  /**/
Karsten Hopp ac36d0
Karsten Hopp ac36d0
-- 
Karsten Hopp ac36d0
An error has occurred.  Hit any user to continue.
Karsten Hopp ac36d0
Karsten Hopp ac36d0
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp ac36d0
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp ac36d0
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp ac36d0
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///