[gdm] When I backed out the last patch, I also accidently reverted a previous fix



commit 54282f9068272b05e0d3bd78fb23400474437eaa
Author: Brian Cameron <Brian Cameron sun com>
Date:   Fri Sep 11 20:23:34 2009 -0500

    When I backed out the last patch, I also accidently reverted a previous fix
    to ensure that the error->message is only referenced when error is not NULL.
    Putting this change back.

 gui/simple-greeter/gdm-user-manager.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-manager.c b/gui/simple-greeter/gdm-user-manager.c
index 7476e5f..6c91b3b 100644
--- a/gui/simple-greeter/gdm-user-manager.c
+++ b/gui/simple-greeter/gdm-user-manager.c
@@ -1657,8 +1657,12 @@ gdm_user_manager_init (GdmUserManager *manager)
                                   G_CALLBACK (on_shells_monitor_changed),
                                   manager);
         } else {
-                g_warning ("Unable to monitor %s: %s", _PATH_SHELLS, error->message);
-                g_error_free (error);
+                if (error != NULL) {
+                        g_warning ("Unable to monitor %s: %s", _PATH_SHELLS, error->message);
+                        g_error_free (error);
+                } else {
+                        g_warning ("Unable to monitor %s", _PATH_SHELLS);
+                }
         }
         g_object_unref (file);
 
@@ -1678,8 +1682,12 @@ gdm_user_manager_init (GdmUserManager *manager)
                                   G_CALLBACK (on_passwd_monitor_changed),
                                   manager);
         } else {
-                g_warning ("Unable to monitor %s: %s", PATH_PASSWD, error->message);
-                g_error_free (error);
+                if (error != NULL) {
+                        g_warning ("Unable to monitor %s: %s", PATH_PASSWD, error->message);
+                        g_error_free (error);
+                } else {
+                        g_warning ("Unable to monitor %s", PATH_PASSWD);
+                }
         }
         g_object_unref (file);
 



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