e688175
To: vim-dev@vim.org
e688175
Subject: Patch 7.2.035
e688175
Fcc: outbox
e688175
From: Bram Moolenaar <Bram@moolenaar.net>
e688175
Mime-Version: 1.0
e688175
Content-Type: text/plain; charset=ISO-8859-1
e688175
Content-Transfer-Encoding: 8bit
e688175
------------
e688175
e688175
Patch 7.2.035
e688175
Problem:    Mismatches between alloc/malloc, free/vim_free,
e688175
	    realloc/vim_realloc.
e688175
Solution:   Use the right function. (Dominique Pelle)
e688175
Files:	    src/gui_x11.c, src/mbyte.c, src/misc2.c, src/os_unix.c
e688175
e688175
e688175
*** ../vim-7.2.034/src/gui_x11.c	Fri Jun 20 11:59:25 2008
e688175
--- src/gui_x11.c	Wed Nov 12 11:47:03 2008
e688175
***************
e688175
*** 2450,2456 ****
e688175
  	*colorPtr = colortable[closest];
e688175
      }
e688175
  
e688175
!     free(colortable);
e688175
      return OK;
e688175
  }
e688175
  
e688175
--- 2450,2456 ----
e688175
  	*colorPtr = colortable[closest];
e688175
      }
e688175
  
e688175
!     vim_free(colortable);
e688175
      return OK;
e688175
  }
e688175
  
e688175
*** ../vim-7.2.034/src/mbyte.c	Sat Sep  6 16:44:06 2008
e688175
--- src/mbyte.c	Wed Nov 12 11:24:14 2008
e688175
***************
e688175
*** 5384,5390 ****
e688175
  			draw_feedback = (char *)alloc(draw_data->chg_first
e688175
  							      + text->length);
e688175
  		    else
e688175
! 			draw_feedback = realloc(draw_feedback,
e688175
  					 draw_data->chg_first + text->length);
e688175
  		    if (draw_feedback != NULL)
e688175
  		    {
e688175
--- 5384,5390 ----
e688175
  			draw_feedback = (char *)alloc(draw_data->chg_first
e688175
  							      + text->length);
e688175
  		    else
e688175
! 			draw_feedback = vim_realloc(draw_feedback,
e688175
  					 draw_data->chg_first + text->length);
e688175
  		    if (draw_feedback != NULL)
e688175
  		    {
e688175
*** ../vim-7.2.034/src/misc2.c	Sat Sep  6 16:44:06 2008
e688175
--- src/misc2.c	Wed Nov 12 11:42:51 2008
e688175
***************
e688175
*** 873,879 ****
e688175
  	    /* 3. check for available memory: call mch_avail_mem() */
e688175
  	    if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
e688175
  	    {
e688175
! 		vim_free((char *)p);	/* System is low... no go! */
e688175
  		p = NULL;
e688175
  	    }
e688175
  	    else
e688175
--- 873,879 ----
e688175
  	    /* 3. check for available memory: call mch_avail_mem() */
e688175
  	    if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
e688175
  	    {
e688175
! 		free((char *)p);	/* System is low... no go! */
e688175
  		p = NULL;
e688175
  	    }
e688175
  	    else
e688175
*** ../vim-7.2.034/src/os_unix.c	Wed Aug  6 18:45:01 2008
e688175
--- src/os_unix.c	Wed Nov 12 11:55:33 2008
e688175
***************
e688175
*** 2905,2911 ****
e688175
       * Ignore any errors.
e688175
       */
e688175
  #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
e688175
!     signal_stack = malloc(SIGSTKSZ);
e688175
      init_signal_stack();
e688175
  #endif
e688175
  }
e688175
--- 2905,2911 ----
e688175
       * Ignore any errors.
e688175
       */
e688175
  #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
e688175
!     signal_stack = (char *)alloc(SIGSTKSZ);
e688175
      init_signal_stack();
e688175
  #endif
e688175
  }
e688175
***************
e688175
*** 6814,6820 ****
e688175
      if (xsmp_icefd != -1)
e688175
      {
e688175
  	SmcCloseConnection(xsmp.smcconn, 0, NULL);
e688175
! 	vim_free(xsmp.clientid);
e688175
  	xsmp.clientid = NULL;
e688175
  	xsmp_icefd = -1;
e688175
      }
e688175
--- 6815,6822 ----
e688175
      if (xsmp_icefd != -1)
e688175
      {
e688175
  	SmcCloseConnection(xsmp.smcconn, 0, NULL);
e688175
! 	if (xsmp.clientid != NULL)
e688175
! 	    free(xsmp.clientid);
e688175
  	xsmp.clientid = NULL;
e688175
  	xsmp_icefd = -1;
e688175
      }
e688175
*** ../vim-7.2.034/src/version.c	Wed Nov 12 12:51:38 2008
e688175
--- src/version.c	Wed Nov 12 13:05:40 2008
e688175
***************
e688175
*** 678,679 ****
e688175
--- 678,681 ----
e688175
  {   /* Add new patch number below this line */
e688175
+ /**/
e688175
+     35,
e688175
  /**/
e688175
e688175
-- 
e688175
You can tune a file system, but you can't tuna fish
e688175
							-- man tunefs
e688175
e688175
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
e688175
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
e688175
\\\        download, build and distribute -- http://www.A-A-P.org        ///
e688175
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///