PATCH: xsettings-manager segfaults if a manager is already running

Travis Spencer travislspencer at gmail.com
Fri Aug 5 21:19:51 EEST 2005


If the xsettings-manager is already running and the user selects
`Exit' in the message box, an XSettingsManager object is never
allocated.  As a result, in manager.c when xsettings_manager_destroy
is called in main, manager will be NULL.  Consequently, in that
function, XDestroyWindow will core when manager is dereferenced.  The
following patch fixes this by returning if manager is NULL.

-- 

Regards,

Travis Spencer

Index: xsettings-manager.c
===================================================================
RCS file: /cvs/xsettings/xsettings/xsettings-manager.c,v
retrieving revision 1.4
diff -u -p -w -r1.4 xsettings-manager.c
--- xsettings-manager.c 10 May 2001 19:24:37 -0000      1.4
+++ xsettings-manager.c 5 Aug 2005 18:08:27 -0000
@@ -189,6 +189,9 @@ xsettings_manager_new (Display
 void
  xsettings_manager_destroy (XSettingsManager *manager)
 {
+  if (!manager)
+    return;
+
   XDestroyWindow (manager->display, manager->window);

   xsettings_list_free (manager->settings);



More information about the xdg mailing list