diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-10-31 16:30:35 +0100 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-04-28 19:41:28 +0000 |
commit | 54d7a7d2abee762b42f8e93ad68ecafd5443fe75 (patch) | |
tree | c18ab02f44cd6059bf1c064aed2689828ef4a35d /daemon | |
parent | 708fb3022b5515fc8a39d51beb4e35ea86634578 (diff) | |
download | gdm-54d7a7d2abee762b42f8e93ad68ecafd5443fe75.tar.gz |
gdm-legacy-display: Plug a memory leak
display_name and seat_id were leaked. While at it, use g_autoptr() for
launch_environment.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-legacy-display.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/daemon/gdm-legacy-display.c b/daemon/gdm-legacy-display.c index e53d82b2..786da483 100644 --- a/daemon/gdm-legacy-display.c +++ b/daemon/gdm-legacy-display.c @@ -93,14 +93,11 @@ static gboolean gdm_legacy_display_prepare (GdmDisplay *display) { GdmLegacyDisplay *self = GDM_LEGACY_DISPLAY (display); - GdmLaunchEnvironment *launch_environment; - char *display_name; - char *seat_id; + g_autoptr(GdmLaunchEnvironment) launch_environment = NULL; + g_autofree char *display_name = NULL; + g_autofree gchar *seat_id = NULL; gboolean doing_initial_setup = FALSE; - display_name = NULL; - seat_id = NULL; - g_object_get (self, "x11-display-name", &display_name, "seat-id", &seat_id, @@ -122,7 +119,6 @@ gdm_legacy_display_prepare (GdmDisplay *display) } g_object_set (self, "launch-environment", launch_environment, NULL); - g_object_unref (launch_environment); if (!gdm_display_create_authority (display)) { g_warning ("Unable to set up access control for display %s", |