diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-09-14 17:13:18 +0200 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2022-09-27 15:18:26 +0000 |
commit | 75ac44ec86af05bf01be3420cc733c3dfcb5cd18 (patch) | |
tree | 701a083eedb1bfcf71e4808244e1f4c041cb10c5 /daemon | |
parent | 8edb5c4aef9bfa3a1d12a496c289644d330d3407 (diff) | |
download | gdm-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.c | 5 |
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; } |