Blame SOURCES/0003-xdmcp-display-factory-Clear-launch-environment-when-.patch

a1b388
From 7c9e236f9015aae2ea5868b67ff8036766cb7099 Mon Sep 17 00:00:00 2001
a1b388
From: Ray Strode <rstrode@redhat.com>
a1b388
Date: Tue, 15 Sep 2020 11:28:48 -0400
a1b388
Subject: [PATCH 3/3] xdmcp-display-factory: Clear launch environment when done
a1b388
 with it
a1b388
a1b388
The XDMCP disply factory examines the sessions of its displays'
a1b388
launch environments when the displays change status.
a1b388
a1b388
Unfortunately it leaks a reference to the launch environment when
a1b388
doing that.
a1b388
a1b388
This commit fixes the reference leak which leads to an fd leak.
a1b388
---
a1b388
 daemon/gdm-xdmcp-display-factory.c | 2 ++
a1b388
 1 file changed, 2 insertions(+)
a1b388
a1b388
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
a1b388
index 2e14beab4..98232113f 100644
a1b388
--- a/daemon/gdm-xdmcp-display-factory.c
a1b388
+++ b/daemon/gdm-xdmcp-display-factory.c
a1b388
@@ -2091,60 +2091,62 @@ on_display_status_changed (GdmDisplay             *display,
a1b388
                 gdm_display_factory_queue_purge_displays (GDM_DISPLAY_FACTORY (factory));
a1b388
                 break;
a1b388
         case GDM_DISPLAY_FAILED:
a1b388
                 gdm_display_factory_queue_purge_displays (GDM_DISPLAY_FACTORY (factory));
a1b388
                 break;
a1b388
         case GDM_DISPLAY_UNMANAGED:
a1b388
                 if (session != NULL) {
a1b388
                         g_signal_handlers_disconnect_by_func (G_OBJECT (session),
a1b388
                                                               G_CALLBACK (on_client_disconnected),
a1b388
                                                               display);
a1b388
                 }
a1b388
                 break;
a1b388
         case GDM_DISPLAY_PREPARED:
a1b388
                 break;
a1b388
         case GDM_DISPLAY_MANAGED:
a1b388
                 if (session != NULL) {
a1b388
                         g_signal_connect_object (G_OBJECT (session),
a1b388
                                                  "client-disconnected",
a1b388
                                                  G_CALLBACK (on_client_disconnected),
a1b388
                                                  display, G_CONNECT_SWAPPED);
a1b388
                         g_signal_connect_object (G_OBJECT (session),
a1b388
                                                  "disconnected",
a1b388
                                                  G_CALLBACK (on_client_disconnected),
a1b388
                                                  display, G_CONNECT_SWAPPED);
a1b388
                 }
a1b388
                 break;
a1b388
         default:
a1b388
                 g_assert_not_reached ();
a1b388
                 break;
a1b388
         }
a1b388
+
a1b388
+        g_clear_object (&launch_environment);
a1b388
 }
a1b388
 
a1b388
 static GdmDisplay *
a1b388
 gdm_xdmcp_display_create (GdmXdmcpDisplayFactory *factory,
a1b388
                           const char             *hostname,
a1b388
                           GdmAddress             *address,
a1b388
                           int                     displaynum)
a1b388
 {
a1b388
         GdmDisplay      *display;
a1b388
         GdmDisplayStore *store;
a1b388
         gboolean         use_chooser;
a1b388
 
a1b388
         g_debug ("GdmXdmcpDisplayFactory: Creating xdmcp display for %s:%d",
a1b388
                 hostname ? hostname : "(null)", displaynum);
a1b388
 
a1b388
         use_chooser = FALSE;
a1b388
         if (factory->priv->honor_indirect) {
a1b388
                 IndirectClient *ic;
a1b388
 
a1b388
                 ic = indirect_client_lookup (factory, address);
a1b388
 
a1b388
                 /* This was an indirect thingie and nothing was yet chosen,
a1b388
                  * use a chooser */
a1b388
                 if (ic != NULL && ic->chosen_address == NULL) {
a1b388
                         use_chooser = TRUE;
a1b388
                 }
a1b388
         }
a1b388
 
a1b388
         if (use_chooser) {
a1b388
                 display = gdm_xdmcp_chooser_display_new (hostname,
a1b388
-- 
a1b388
2.26.2
a1b388