gdm r6682 - in branches/gnome-2-20: . daemon



Author: bcameron
Date: Thu Feb  5 22:23:15 2009
New Revision: 6682
URL: http://svn.gnome.org/viewvc/gdm?rev=6682&view=rev

Log:
2009-02-05 Brian Cameron <brian cameron sun com>

        * daemon/gdm-xdmcp-manager.c: Remove double free and improve error
          handling, patch by Chris Wilson (chris+gnome aptivate org).  Also fix
          how the host variable is freed in gdm_xdmcp_handle_message so it
          is not freed before it is last used.  This issue was noticed by
          Giuseppe Lippolis (giuseppe lippolis thalesaleniaspace com).  Fixes
          two issues noted in bug #530585, though I suspect it does not
          resolve the main issue of the bug..
        * daemon/server.c: Improve error handling.


Modified:
   branches/gnome-2-20/ChangeLog
   branches/gnome-2-20/daemon/gdm-xdmcp-manager.c
   branches/gnome-2-20/daemon/server.c

Modified: branches/gnome-2-20/daemon/gdm-xdmcp-manager.c
==============================================================================
--- branches/gnome-2-20/daemon/gdm-xdmcp-manager.c	(original)
+++ branches/gnome-2-20/daemon/gdm-xdmcp-manager.c	Thu Feb  5 22:23:15 2009
@@ -401,12 +401,12 @@
 
 	sock = socket (ai->ai_family, ai->ai_socktype, ai->ai_protocol);
 	if (sock < 0) {
-		gdm_debug ("socket: %s", g_strerror (errno));
+		gdm_error ("socket: %s", g_strerror (errno));
 		return sock;
 	}
 
 	if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0) {
-		gdm_debug ("bind: %s", g_strerror (errno));
+		gdm_error ("bind: %s", g_strerror (errno));
 		close (sock);
 		return -1;
 	}
@@ -728,7 +728,6 @@
 
 		s = get_willing_output (manager);
 		if (s != NULL) {
-			g_free (last_status);
 			last_status = s;
 		} else {
 			last_status = g_strdup (manager->priv->sysid);
@@ -2169,12 +2168,12 @@
 		g_free (host);
 		return;
 	}
-	g_free (host);
 
 	/* SessionID */
 	if G_UNLIKELY (! XdmcpReadCARD32 (&manager->priv->buf, &clnt_sessid)) {
 		gdm_debug ("%s: Could not read Session ID",
 			   "gdm_xdmcp_handle_manage");
+		g_free (host);
 		return;
 	}
 
@@ -2182,6 +2181,7 @@
 	if G_UNLIKELY (! XdmcpReadCARD16 (&manager->priv->buf, &clnt_dspnum)) {
 		gdm_debug ("%s: Could not read Display Number",
 			   "gdm_xdmcp_handle_manage");
+		g_free (host);
 		return;
 	}
 
@@ -2189,6 +2189,7 @@
 	if G_UNLIKELY (! XdmcpReadARRAY8 (&manager->priv->buf, &clnt_dspclass)) {
 		gdm_debug ("%s: Could not read Display Class",
 			   "gdm_xdmcp_handle_manage");
+		g_free (host);
 		return;
 	}
 
@@ -2198,6 +2199,7 @@
 			   (int)clnt_dspnum, (long)clnt_sessid, ve_sure_string (s), host);
 		g_free (s);
 	}
+	g_free (host);
 
 	d = gdm_xdmcp_display_lookup (manager, clnt_sessid);
 	if (d != NULL &&

Modified: branches/gnome-2-20/daemon/server.c
==============================================================================
--- branches/gnome-2-20/daemon/server.c	(original)
+++ branches/gnome-2-20/daemon/server.c	Thu Feb  5 22:23:15 2009
@@ -974,15 +974,19 @@
 			g_shell_parse_argv (str, &argc, &argv, NULL);
 
 		} else {
+			GError* error_p;
 			char **svr_command;
 			const char *str;
 			int svr_argc;
 
 			str = ve_sure_string (svr->command);
 			svr_command = NULL;
-			g_shell_parse_argv (str, &svr_argc, &svr_command, NULL);
 
-			g_shell_parse_argv (disp->command, &argc, &argv, NULL);
+			g_shell_parse_argv (str, &svr_argc,
+				&svr_command, &error_p);
+
+			g_shell_parse_argv (disp->command, &argc,
+				&argv, &error_p);
 
 			if (argv[0] == NULL || argv[1] == NULL) {
 				g_strfreev (argv);



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