A double free can result if your app calls
XmRemoveProtocols.  Patch follows ...

- Steve

*** lesstif-0.91.3/lib/Xm/Protocols.c.orig      Mon Apr 12 13:04:16 1999
--- lesstif-0.91.3/lib/Xm/Protocols.c   Sat Jul  8 04:35:31 2000
***************
*** 394,400 ****
                XtFree((char*) mgr);
        }
        
!       XtFree((char*) allmgrs->protocol_mgrs);
        
        XtFree((char*)allmgrs);
        XtRemoveEventHandler(w, XtAllEvents, True, _XmProtocolHandler, NULL);
--- 394,401 ----
                XtFree((char*) mgr);
        }
        
!       if (allmgrs->protocol_mgrs)
!               XtFree((char*) allmgrs->protocol_mgrs);
        
        XtFree((char*)allmgrs);
        XtRemoveEventHandler(w, XtAllEvents, True, _XmProtocolHandler, NULL);
***************
*** 823,830 ****
--- 824,833 ----
                        if ( --(mgrs->num_protocol_mgrs) == 0 )
                        {
                                XtFree((char*) mgrs->protocol_mgrs);
+                               mgrs->protocol_mgrs = NULL;
                                mgrs->max_protocol_mgrs = 0;
                        }
+ 
                        /* IMPORTANT NOTE: If we should get here, mgr is does not exist
                         *                 anymore and hence we must leave the loop
                         *                                 immediately.



--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.

Reply via email to