Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.195
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.195
Karsten Hopp 81c285
Problem:    Leaking memory for the command Vim was started with.
Karsten Hopp 81c285
Solution:   Remember the pointer and free it.
Karsten Hopp 81c285
Files:	    src/gui_gtk_x11.c
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.194/src/gui_gtk_x11.c	2009-05-17 16:23:20.000000000 +0200
Karsten Hopp 81c285
--- src/gui_gtk_x11.c	2009-06-03 12:44:31.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 412,417 ****
Karsten Hopp 81c285
--- 412,418 ----
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
Karsten Hopp 81c285
  static const char *restart_command = NULL;
Karsten Hopp 81c285
+ static       char *abs_restart_command = NULL;
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  static int found_iconic_arg = FALSE;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 449,456 ****
Karsten Hopp 81c285
  	char_u buf[MAXPATHL];
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  	if (mch_FullName((char_u *)argv[0], buf, (int)sizeof(buf), TRUE) == OK)
Karsten Hopp 81c285
! 	    /* Tiny leak; doesn't matter, and usually we don't even get here */
Karsten Hopp 81c285
! 	    restart_command = (char *)vim_strsave(buf);
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
--- 450,459 ----
Karsten Hopp 81c285
  	char_u buf[MAXPATHL];
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  	if (mch_FullName((char_u *)argv[0], buf, (int)sizeof(buf), TRUE) == OK)
Karsten Hopp 81c285
! 	{
Karsten Hopp 81c285
! 	    abs_restart_command = (char *)vim_strsave(buf);
Karsten Hopp 81c285
! 	    restart_command = abs_restart_command;
Karsten Hopp 81c285
! 	}
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 611,616 ****
Karsten Hopp 81c285
--- 614,622 ----
Karsten Hopp 81c285
  gui_mch_free_all()
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
      vim_free(gui_argv);
Karsten Hopp 81c285
+ #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
Karsten Hopp 81c285
+     vim_free(abs_restart_command);
Karsten Hopp 81c285
+ #endif
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  
Karsten Hopp 81c285
*** ../vim-7.2.194/src/version.c	2009-06-03 15:05:05.000000000 +0200
Karsten Hopp 81c285
--- src/version.c	2009-06-03 16:19:00.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     195,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
I think that you'll agree that engineers are very effective in their social
Karsten Hopp 81c285
interactions.  It's the "normal" people who are nuts.
Karsten Hopp 81c285
				(Scott Adams - The Dilbert principle)
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///