[gdm/gnome-2-30] g_array_free doesn't allow NULLs



commit d14a5028871d64f7edaf698d3d66a499e57692f9
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Jun 16 19:53:47 2010 -0400

    g_array_free doesn't allow NULLs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=589536

 daemon/gdm-slave.c                 |    4 +++-
 daemon/gdm-xdmcp-display-factory.c |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index b4be763..7e57f4f 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -1678,7 +1678,9 @@ gdm_slave_finalize (GObject *object)
         g_free (slave->priv->parent_display_name);
         g_free (slave->priv->parent_display_x11_authority_file);
         g_free (slave->priv->windowpath);
-        g_array_free (slave->priv->display_x11_cookie, TRUE);
+        if (slave->priv->display_x11_cookie != NULL) {
+                g_array_free (slave->priv->display_x11_cookie, TRUE);
+        }
 
         G_OBJECT_CLASS (gdm_slave_parent_class)->finalize (object);
 }
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 116cc97..06fafae 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -2353,8 +2353,10 @@ gdm_xdmcp_handle_request (GdmXdmcpDisplayFactory *factory,
                                 GArray *cookie;
                                 char   *name;
 
+                                cookie = NULL;
                                 gdm_display_get_x11_cookie (display, &cookie, NULL);
 
+                                name = NULL;
                                 gdm_display_get_x11_display_name (display, &name, NULL);
 
                                 g_debug ("GdmXdmcpDisplayFactory: Sending authorization key for display %s", name ? name : "(null)");



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