summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorAlessandro Bono <alessandro.bono369@gmail.com>2022-09-14 17:13:18 +0200
committerRay Strode <halfline@gmail.com>2022-09-27 15:18:26 +0000
commit75ac44ec86af05bf01be3420cc733c3dfcb5cd18 (patch)
tree701a083eedb1bfcf71e4808244e1f4c041cb10c5 /daemon
parent8edb5c4aef9bfa3a1d12a496c289644d330d3407 (diff)
downloadgdm-75ac44ec86af05bf01be3420cc733c3dfcb5cd18.tar.gz
gdm-local-display-factory: Plug a memory leak
The error was never freed. While at it, convert also the id to use g_autofree.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gdm-local-display-factory.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
index 8c912cc6..dae2b241 100644
--- a/daemon/gdm-local-display-factory.c
+++ b/daemon/gdm-local-display-factory.c
@@ -1502,9 +1502,9 @@ handle_create_transient_display (GdmDBusLocalDisplayFactory *skeleton,
GDBusMethodInvocation *invocation,
GdmLocalDisplayFactory *factory)
{
- GError *error = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autofree char *id = NULL;
gboolean created;
- char *id = NULL;
created = gdm_local_display_factory_create_transient_display (factory,
&id,
@@ -1515,7 +1515,6 @@ handle_create_transient_display (GdmDBusLocalDisplayFactory *skeleton,
gdm_dbus_local_display_factory_complete_create_transient_display (skeleton, invocation, id);
}
- g_free (id);
return TRUE;
}