Karsten Hopp 3e2013
To: vim_dev@googlegroups.com
Karsten Hopp 3e2013
Subject: Patch 7.4.696
Karsten Hopp 3e2013
Fcc: outbox
Karsten Hopp 3e2013
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 3e2013
Mime-Version: 1.0
Karsten Hopp 3e2013
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 3e2013
Content-Transfer-Encoding: 8bit
Karsten Hopp 3e2013
------------
Karsten Hopp 3e2013
Karsten Hopp 3e2013
Patch 7.4.696
Karsten Hopp 3e2013
Problem:    Not freeing memory when encountering an error.
Karsten Hopp 3e2013
Solution:   Free the stack before returning. (Eliseo Martínez)
Karsten Hopp 3e2013
Files:      src/regexp_nfa.c
Karsten Hopp 3e2013
Karsten Hopp 3e2013
Karsten Hopp 3e2013
*** ../vim-7.4.695/src/regexp_nfa.c	2015-03-05 17:16:02.620687666 +0100
Karsten Hopp 3e2013
--- src/regexp_nfa.c	2015-04-13 15:18:36.078662211 +0200
Karsten Hopp 3e2013
***************
Karsten Hopp 3e2013
*** 3156,3161 ****
Karsten Hopp 3e2013
--- 3156,3162 ----
Karsten Hopp 3e2013
  		    if (stackp < stack)			\
Karsten Hopp 3e2013
  		    {					\
Karsten Hopp 3e2013
  			st_error(postfix, end, p);	\
Karsten Hopp 3e2013
+ 			vim_free(stack);		\
Karsten Hopp 3e2013
  			return NULL;			\
Karsten Hopp 3e2013
  		    }
Karsten Hopp 3e2013
  
Karsten Hopp 3e2013
***************
Karsten Hopp 3e2013
*** 3632,3641 ****
Karsten Hopp 3e2013
--- 3633,3648 ----
Karsten Hopp 3e2013
  
Karsten Hopp 3e2013
      e = POP();
Karsten Hopp 3e2013
      if (stackp != stack)
Karsten Hopp 3e2013
+     {
Karsten Hopp 3e2013
+ 	vim_free(stack);
Karsten Hopp 3e2013
  	EMSG_RET_NULL(_("E875: (NFA regexp) (While converting from postfix to NFA), too many states left on stack"));
Karsten Hopp 3e2013
+     }
Karsten Hopp 3e2013
  
Karsten Hopp 3e2013
      if (istate >= nstate)
Karsten Hopp 3e2013
+     {
Karsten Hopp 3e2013
+ 	vim_free(stack);
Karsten Hopp 3e2013
  	EMSG_RET_NULL(_("E876: (NFA regexp) Not enough space to store the whole NFA "));
Karsten Hopp 3e2013
+     }
Karsten Hopp 3e2013
  
Karsten Hopp 3e2013
      matchstate = &state_ptr[istate++]; /* the match state */
Karsten Hopp 3e2013
      matchstate->c = NFA_MATCH;
Karsten Hopp 3e2013
*** ../vim-7.4.695/src/version.c	2015-04-13 14:45:10.696707013 +0200
Karsten Hopp 3e2013
--- src/version.c	2015-04-13 15:26:18.109607819 +0200
Karsten Hopp 3e2013
***************
Karsten Hopp 3e2013
*** 743,744 ****
Karsten Hopp 3e2013
--- 743,746 ----
Karsten Hopp 3e2013
  {   /* Add new patch number below this line */
Karsten Hopp 3e2013
+ /**/
Karsten Hopp 3e2013
+     696,
Karsten Hopp 3e2013
  /**/
Karsten Hopp 3e2013
Karsten Hopp 3e2013
-- 
Karsten Hopp 3e2013
This message contains 78% recycled characters.
Karsten Hopp 3e2013
Karsten Hopp 3e2013
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 3e2013
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 3e2013
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 3e2013
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///