3dd8869
To: vim-dev@vim.org
3dd8869
Subject: Patch 7.2.271
3dd8869
Fcc: outbox
3dd8869
From: Bram Moolenaar <Bram@moolenaar.net>
3dd8869
Mime-Version: 1.0
3dd8869
Content-Type: text/plain; charset=UTF-8
3dd8869
Content-Transfer-Encoding: 8bit
3dd8869
------------
3dd8869
3dd8869
Patch 7.2.271
3dd8869
Problem:    Using freed memory in Motif GUI version when making a choice.
3dd8869
Solution:   Free memory only after using it. (Dominique Pelle)
3dd8869
Files:	    src/gui_xmdlg.c
3dd8869
3dd8869
3dd8869
*** ../vim-7.2.270/src/gui_xmdlg.c	2009-05-21 23:25:38.000000000 +0200
3dd8869
--- src/gui_xmdlg.c	2009-10-28 21:56:15.000000000 +0100
3dd8869
***************
3dd8869
*** 10,16 ****
3dd8869
  /*
3dd8869
   * (C) 2001,2005 by Marcin Dalecki <martin@dalecki.de>
3dd8869
   *
3dd8869
!  * Implementation of dialogue functions for the Motif GUI variant.
3dd8869
   *
3dd8869
   * Note about Lesstif: Apparently lesstif doesn't get the widget layout right,
3dd8869
   * when using a dynamic scrollbar policy.
3dd8869
--- 10,16 ----
3dd8869
  /*
3dd8869
   * (C) 2001,2005 by Marcin Dalecki <martin@dalecki.de>
3dd8869
   *
3dd8869
!  * Implementation of dialog functions for the Motif GUI variant.
3dd8869
   *
3dd8869
   * Note about Lesstif: Apparently lesstif doesn't get the widget layout right,
3dd8869
   * when using a dynamic scrollbar policy.
3dd8869
***************
3dd8869
*** 633,648 ****
3dd8869
  	data->sel[which] = XtNewString(sel);
3dd8869
      else
3dd8869
      {
3dd8869
- 	XtFree(data->sel[which]);
3dd8869
  	if (!strcmp(data->sel[which], sel))
3dd8869
  	{
3dd8869
  	    /* unselecting current selection */
3dd8869
  	    data->sel[which] = NULL;
3dd8869
  	    if (w)
3dd8869
  		XmListDeselectItem(w, call_data->item);
3dd8869
  	}
3dd8869
  	else
3dd8869
  	    data->sel[which] = XtNewString(sel);
3dd8869
      }
3dd8869
      XtFree(sel);
3dd8869
  
3dd8869
--- 633,651 ----
3dd8869
  	data->sel[which] = XtNewString(sel);
3dd8869
      else
3dd8869
      {
3dd8869
  	if (!strcmp(data->sel[which], sel))
3dd8869
  	{
3dd8869
  	    /* unselecting current selection */
3dd8869
+ 	    XtFree(data->sel[which]);
3dd8869
  	    data->sel[which] = NULL;
3dd8869
  	    if (w)
3dd8869
  		XmListDeselectItem(w, call_data->item);
3dd8869
  	}
3dd8869
  	else
3dd8869
+ 	{
3dd8869
+ 	    XtFree(data->sel[which]);
3dd8869
  	    data->sel[which] = XtNewString(sel);
3dd8869
+ 	}
3dd8869
      }
3dd8869
      XtFree(sel);
3dd8869
  
3dd8869
*** ../vim-7.2.270/src/version.c	2009-11-03 12:38:50.000000000 +0100
3dd8869
--- src/version.c	2009-11-03 12:48:26.000000000 +0100
3dd8869
***************
3dd8869
*** 678,679 ****
3dd8869
--- 678,681 ----
3dd8869
  {   /* Add new patch number below this line */
3dd8869
+ /**/
3dd8869
+     271,
3dd8869
  /**/
3dd8869
3dd8869
-- 
3dd8869
ROBIN:  (warily) And if you get a question wrong?
3dd8869
ARTHUR: You are cast into the Gorge of Eternal Peril.
3dd8869
ROBIN:  Oh ... wacho!
3dd8869
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
3dd8869
3dd8869
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3dd8869
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3dd8869
\\\        download, build and distribute -- http://www.A-A-P.org        ///
3dd8869
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///