I encountered today a crash in xgps that should
be fixed by this patch.  



2002-01-19  Willem Rein Oudshoorn  <[EMAIL PROTECTED]>

        * Source/SharedX/XGContextEvent.m ([XGContext 
-receivedEvent:type:extra:forMode:]): 
        check if XQueryTree calls succeed, and avoid XFree'ing a NULL pointer.




Index: XGContextEvent.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/xgps/Source/SharedX/XGContextEvent.m,v
retrieving revision 1.80
diff -c -r1.80 XGContextEvent.m
*** XGContextEvent.m	9 Jan 2002 20:46:21 -0000	1.80
--- XGContextEvent.m	19 Jan 2002 17:34:36 -0000
***************
*** 1142,1150 ****
  		      int nchildren;
  	    
  		      parent = new_parent;
! 		      XQueryTree(XDPY, parent, &root, &new_parent, 
! 				 &children, &nchildren);
! 		      XFree(children);
  		    } 
  		    cWin->parent = parent;
  		  }
--- 1142,1156 ----
  		      int nchildren;
  	    
  		      parent = new_parent;
! 		      if (!XQueryTree(XDPY, parent, &root, &new_parent, 
!                                       &children, &nchildren))
!                         {
!                           new_parent = None;
!                         }
! 		      if (children)
!                         {
!                           XFree(children);
!                         }
  		    } 
  		    cWin->parent = parent;
  		  }

Reply via email to