69f59b2
To: vim-dev@vim.org
69f59b2
Subject: Patch 7.1.147
69f59b2
Fcc: outbox
69f59b2
From: Bram Moolenaar <Bram@moolenaar.net>
69f59b2
Mime-Version: 1.0
69f59b2
Content-Type: text/plain; charset=ISO-8859-1
69f59b2
Content-Transfer-Encoding: 8bit
69f59b2
------------
69f59b2
69f59b2
Patch 7.1.147 (after 7.1.127)
69f59b2
Problem:    Freeing memory already freed when completing user name. (Meino
69f59b2
	    Cramer)
69f59b2
Solution:   Use a flag to remember if "orig" needs to be freed.
69f59b2
Files:	    src/ex_getln.c
69f59b2
69f59b2
69f59b2
*** ../vim-7.1.146/src/ex_getln.c	Sun Sep 30 22:10:45 2007
69f59b2
--- src/ex_getln.c	Tue Oct 30 17:13:33 2007
69f59b2
***************
69f59b2
*** 3353,3358 ****
69f59b2
--- 3353,3359 ----
69f59b2
      char_u	*ss = NULL;
69f59b2
      static int	findex;
69f59b2
      static char_u *orig_save = NULL;	/* kept value of orig */
69f59b2
+     int		orig_saved = FALSE;
69f59b2
      int		i;
69f59b2
      long_u	len;
69f59b2
      int		non_suf_match;		/* number without matching suffix */
69f59b2
***************
69f59b2
*** 3421,3426 ****
69f59b2
--- 3422,3428 ----
69f59b2
      {
69f59b2
  	vim_free(orig_save);
69f59b2
  	orig_save = orig;
69f59b2
+ 	orig_saved = TRUE;
69f59b2
  
69f59b2
  	/*
69f59b2
  	 * Do the expansion.
69f59b2
***************
69f59b2
*** 3546,3552 ****
69f59b2
  	ExpandCleanup(xp);
69f59b2
  
69f59b2
      /* Free "orig" if it wasn't stored in "orig_save". */
69f59b2
!     if (orig != orig_save)
69f59b2
  	vim_free(orig);
69f59b2
  
69f59b2
      return ss;
69f59b2
--- 3548,3554 ----
69f59b2
  	ExpandCleanup(xp);
69f59b2
  
69f59b2
      /* Free "orig" if it wasn't stored in "orig_save". */
69f59b2
!     if (!orig_saved)
69f59b2
  	vim_free(orig);
69f59b2
  
69f59b2
      return ss;
69f59b2
*** ../vim-7.1.146/src/version.c	Mon Oct 29 22:37:57 2007
69f59b2
--- src/version.c	Tue Oct 30 17:30:35 2007
69f59b2
***************
69f59b2
*** 668,669 ****
69f59b2
--- 668,671 ----
69f59b2
  {   /* Add new patch number below this line */
69f59b2
+ /**/
69f59b2
+     147,
69f59b2
  /**/
69f59b2
69f59b2
-- 
69f59b2
hundred-and-one symptoms of being an internet addict:
69f59b2
59. Your wife says communication is important in a marriage...so you buy
69f59b2
    another computer and install a second phone line so the two of you can
69f59b2
    chat.
69f59b2
69f59b2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
69f59b2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
69f59b2
\\\        download, build and distribute -- http://www.A-A-P.org        ///
69f59b2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///