[gnome-settings-daemon] daemon: Fix crash when a plugin failed to start



commit 84315ec620be6615cada80cb197c2891663068e0
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jul 15 12:57:55 2014 +0200

    daemon: Fix crash when a plugin failed to start
    
    When a plugin failed to start, and wouldn't return an error, we'd
    crash trying to access the error. The error wasn't immediately
    visible as this part of the code is implemented as one large macro.
    
    This fixes a crash on startup when gnome-settings-daemon is compiled
    with systemd support but logind isn't available on the running system.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732836

 gnome-settings-daemon/gnome-settings-plugin.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome-settings-daemon/gnome-settings-plugin.h b/gnome-settings-daemon/gnome-settings-plugin.h
index 5a167e8..1c505ce 100644
--- a/gnome-settings-daemon/gnome-settings-plugin.h
+++ b/gnome-settings-daemon/gnome-settings-plugin.h
@@ -121,8 +121,8 @@ impl_activate (GnomeSettingsPlugin *plugin)                                    \
         g_debug ("Activating %s plugin", G_STRINGIFY(plugin_name));            \
         plugin_cast = G_TYPE_CHECK_INSTANCE_CAST ((plugin), plugin_name##_plugin_get_type(), 
PluginName##Plugin); \
         if (!plugin_name##_manager_start (plugin_cast->priv->manager, &error)) { \
-                g_warning ("Unable to start %s manager: %s", G_STRINGIFY(plugin_name), error->message); \
-                g_error_free (error);                                          \
+                g_warning ("Unable to start %s manager: %s", G_STRINGIFY(plugin_name), error ? 
error->message : "No reason"); \
+                g_clear_error (&error);                                        \
         }                                                                      \
 }                                                                              \
                                                                                \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]