gdm r6037 - in trunk: . common daemon



Author: mccann
Date: Tue Mar 18 00:19:08 2008
New Revision: 6037
URL: http://svn.gnome.org/viewvc/gdm?rev=6037&view=rev

Log:
2008-03-17  William Jon McCann  <jmccann redhat com>

	* common/gdm-signal-handler.c: (gdm_signal_handler_finalize):
	* daemon/gdm-display.c: (gdm_display_real_create_authority),
	(gdm_display_real_add_user_authorization),
	(gdm_display_constructor):
	* daemon/gdm-slave.c: (gdm_slave_finalize):
	* daemon/main.c: (main):
	Fix a few more mem and fd leaks.



Modified:
   trunk/ChangeLog
   trunk/common/gdm-signal-handler.c
   trunk/daemon/gdm-display-access-file.c
   trunk/daemon/gdm-display.c
   trunk/daemon/gdm-slave.c
   trunk/daemon/main.c

Modified: trunk/common/gdm-signal-handler.c
==============================================================================
--- trunk/common/gdm-signal-handler.c	(original)
+++ trunk/common/gdm-signal-handler.c	Tue Mar 18 00:19:08 2008
@@ -519,6 +519,9 @@
         }
         g_hash_table_destroy (handler->priv->action_lookup);
 
+        close (signal_pipes [0]);
+        close (signal_pipes [1]);
+
         G_OBJECT_CLASS (gdm_signal_handler_parent_class)->finalize (object);
 }
 

Modified: trunk/daemon/gdm-display-access-file.c
==============================================================================
--- trunk/daemon/gdm-display-access-file.c	(original)
+++ trunk/daemon/gdm-display-access-file.c	Tue Mar 18 00:19:08 2008
@@ -339,7 +339,7 @@
                                      gsize                 *cookie_size,
                                      GError               **error)
 {
-        GError *add_error;
+        GError  *add_error;
         gboolean display_added;
 
         g_return_val_if_fail (file != NULL, FALSE);

Modified: trunk/daemon/gdm-display.c
==============================================================================
--- trunk/daemon/gdm-display.c	(original)
+++ trunk/daemon/gdm-display.c	Tue Mar 18 00:19:08 2008
@@ -154,7 +154,8 @@
 gdm_display_real_create_authority (GdmDisplay *display)
 {
         GdmDisplayAccessFile *access_file;
-        GError *error;
+        GError               *error;
+        gboolean              res;
 
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
         g_return_val_if_fail (display->priv->access_file == NULL, FALSE);
@@ -163,15 +164,20 @@
         access_file = _create_access_file_for_user (display, "gdm", &error);
 
         if (access_file == NULL) {
-            g_critical ("could not create display access file: %s", error->message);
-            g_error_free (error);
-            return FALSE;
+                g_critical ("could not create display access file: %s", error->message);
+                g_error_free (error);
+                return FALSE;
         }
 
-        if (!gdm_display_access_file_add_display (access_file, display,
-                                                  &display->priv->x11_cookie,
-                                                  &display->priv->x11_cookie_size,
-                                                  &error)) {
+        g_free (display->priv->x11_cookie);
+        display->priv->x11_cookie = NULL;
+        res = gdm_display_access_file_add_display (access_file,
+                                                   display,
+                                                   &display->priv->x11_cookie,
+                                                   &display->priv->x11_cookie_size,
+                                                   &error);
+
+        if (! res) {
 
                 g_critical ("could not add display to access file: %s", error->message);
                 g_error_free (error);
@@ -207,6 +213,7 @@
 {
         GdmDisplayAccessFile *access_file;
         GError               *access_file_error;
+        gboolean              res;
 
         g_return_val_if_fail (GDM_IS_DISPLAY (display), FALSE);
         g_return_val_if_fail (display->priv->access_file != NULL, FALSE);
@@ -219,15 +226,16 @@
                                                     &access_file_error);
 
         if (access_file == NULL) {
-            g_propagate_error (error, access_file_error);
-            return FALSE;
+                g_propagate_error (error, access_file_error);
+                return FALSE;
         }
 
-        if (!gdm_display_access_file_add_display_with_cookie (access_file,
-                                                              display,
-                                                              display->priv->x11_cookie,
-                                                              display->priv->x11_cookie_size,
-                                                              &access_file_error)) {
+        res = gdm_display_access_file_add_display_with_cookie (access_file,
+                                                               display,
+                                                               display->priv->x11_cookie,
+                                                               display->priv->x11_cookie_size,
+                                                               &access_file_error);
+        if (! res) {
                 g_debug ("GdmDisplay: Unable to add user authorization for %s: %s",
                          username,
                          access_file_error->message);
@@ -822,6 +830,7 @@
                                                                                        n_construct_properties,
                                                                                        construct_properties));
 
+        g_free (display->priv->id);
         display->priv->id = g_strdup_printf ("/org/gnome/DisplayManager/Display%u", get_next_display_serial ());
 
         res = register_display (display);

Modified: trunk/daemon/gdm-slave.c
==============================================================================
--- trunk/daemon/gdm-slave.c	(original)
+++ trunk/daemon/gdm-slave.c	Tue Mar 18 00:19:08 2008
@@ -88,10 +88,6 @@
         char            *parent_display_name;
         char            *parent_display_x11_authority_file;
 
-        /* user selected */
-        char            *selected_session;
-        char            *selected_language;
-
         DBusGProxy      *display_proxy;
         DBusGConnection *connection;
 };
@@ -1357,7 +1353,14 @@
 
         gdm_slave_real_stop (slave);
 
+        g_free (slave->priv->id);
         g_free (slave->priv->display_id);
+        g_free (slave->priv->display_name);
+        g_free (slave->priv->display_hostname);
+        g_free (slave->priv->display_seat_id);
+        g_free (slave->priv->display_x11_authority_file);
+        g_free (slave->priv->parent_display_name);
+        g_free (slave->priv->parent_display_x11_authority_file);
 
         G_OBJECT_CLASS (gdm_slave_parent_class)->finalize (object);
 }

Modified: trunk/daemon/main.c
==============================================================================
--- trunk/daemon/main.c	(original)
+++ trunk/daemon/main.c	Tue Mar 18 00:19:08 2008
@@ -645,6 +645,7 @@
         }
 
         gdm_settings_direct_shutdown ();
+        gdm_log_shutdown ();
 
         g_main_loop_unref (main_loop);
 



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