summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorAlessandro Bono <alessandro.bono369@gmail.com>2022-11-02 17:42:51 +0100
committerRay Strode <halfline@gmail.com>2023-04-28 19:41:28 +0000
commit74308a05b52192d26336488238c4706d1e45f4cd (patch)
tree17d1537fa2f1b6bec09ab35e6fa1b5bce8c75de0 /daemon
parent4f81a7dd95522a870f731d4587605fcafcda68fd (diff)
downloadgdm-74308a05b52192d26336488238c4706d1e45f4cd.tar.gz
gdm-display: Plug a memory leak
error was not freed in the second if branch. While at it use g_autoptr.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-display.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index dd617227..e8b45cce 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -1616,7 +1616,7 @@ kernel_cmdline_initial_setup_argument (const gchar *contents,
static gboolean
kernel_cmdline_initial_setup_force_state (gboolean *force_state)
{
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
gchar *contents = NULL;
gchar *setup_argument = NULL;
@@ -1625,7 +1625,6 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state)
if (!g_file_get_contents ("/proc/cmdline", &contents, NULL, &error)) {
g_debug ("GdmDisplay: Could not check kernel parameters, not forcing initial setup: %s",
error->message);
- g_clear_error (&error);
return FALSE;
}