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