Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.2.035
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.035
Problem:    Mismatches between alloc/malloc, free/vim_free,
	    realloc/vim_realloc.
Solution:   Use the right function. (Dominique Pelle)
Files:	    src/gui_x11.c, src/mbyte.c, src/misc2.c, src/os_unix.c


*** ../vim-7.2.034/src/gui_x11.c	Fri Jun 20 11:59:25 2008
--- src/gui_x11.c	Wed Nov 12 11:47:03 2008
***************
*** 2450,2456 ****
  	*colorPtr = colortable[closest];
      }
  
!     free(colortable);
      return OK;
  }
  
--- 2450,2456 ----
  	*colorPtr = colortable[closest];
      }
  
!     vim_free(colortable);
      return OK;
  }
  
*** ../vim-7.2.034/src/mbyte.c	Sat Sep  6 16:44:06 2008
--- src/mbyte.c	Wed Nov 12 11:24:14 2008
***************
*** 5384,5390 ****
  			draw_feedback = (char *)alloc(draw_data->chg_first
  							      + text->length);
  		    else
! 			draw_feedback = realloc(draw_feedback,
  					 draw_data->chg_first + text->length);
  		    if (draw_feedback != NULL)
  		    {
--- 5384,5390 ----
  			draw_feedback = (char *)alloc(draw_data->chg_first
  							      + text->length);
  		    else
! 			draw_feedback = vim_realloc(draw_feedback,
  					 draw_data->chg_first + text->length);
  		    if (draw_feedback != NULL)
  		    {
*** ../vim-7.2.034/src/misc2.c	Sat Sep  6 16:44:06 2008
--- src/misc2.c	Wed Nov 12 11:42:51 2008
***************
*** 873,879 ****
  	    /* 3. check for available memory: call mch_avail_mem() */
  	    if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
  	    {
! 		vim_free((char *)p);	/* System is low... no go! */
  		p = NULL;
  	    }
  	    else
--- 873,879 ----
  	    /* 3. check for available memory: call mch_avail_mem() */
  	    if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
  	    {
! 		free((char *)p);	/* System is low... no go! */
  		p = NULL;
  	    }
  	    else
*** ../vim-7.2.034/src/os_unix.c	Wed Aug  6 18:45:01 2008
--- src/os_unix.c	Wed Nov 12 11:55:33 2008
***************
*** 2905,2911 ****
       * Ignore any errors.
       */
  #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
!     signal_stack = malloc(SIGSTKSZ);
      init_signal_stack();
  #endif
  }
--- 2905,2911 ----
       * Ignore any errors.
       */
  #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
!     signal_stack = (char *)alloc(SIGSTKSZ);
      init_signal_stack();
  #endif
  }
***************
*** 6814,6820 ****
      if (xsmp_icefd != -1)
      {
  	SmcCloseConnection(xsmp.smcconn, 0, NULL);
! 	vim_free(xsmp.clientid);
  	xsmp.clientid = NULL;
  	xsmp_icefd = -1;
      }
--- 6815,6822 ----
      if (xsmp_icefd != -1)
      {
  	SmcCloseConnection(xsmp.smcconn, 0, NULL);
! 	if (xsmp.clientid != NULL)
! 	    free(xsmp.clientid);
  	xsmp.clientid = NULL;
  	xsmp_icefd = -1;
      }
*** ../vim-7.2.034/src/version.c	Wed Nov 12 12:51:38 2008
--- src/version.c	Wed Nov 12 13:05:40 2008
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     35,
  /**/

-- 
You can tune a file system, but you can't tuna fish
							-- man tunefs

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///