diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-11-09 11:27:49 +0100 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-04-28 19:41:28 +0000 |
commit | 021a710fc7049b4d39ef7b99be2fa1bfe02e8e9e (patch) | |
tree | e1bb5a8f1d9e5d06f0e02c77d0fc8dce0bf371d2 /daemon | |
parent | 536c38cd936c7c7030922556b6d351f5224fe937 (diff) | |
download | gdm-021a710fc7049b4d39ef7b99be2fa1bfe02e8e9e.tar.gz |
gdm-sessoin-worker: Plug a memory leak
gdm_dbus_worker_manager_call_choice_list_query_sync does not take
ownership of choices_as_variant. We must free it. While at it, use
g_autoptr.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-session-worker.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c index b062fdd7..b5841272 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c @@ -536,9 +536,9 @@ gdm_session_worker_ask_list_of_choices (GdmSessionWorker *worker, GdmChoiceList *list, char **answerp) { + g_autoptr(GVariant) choices_as_variant = NULL; + g_autoptr(GError) error = NULL; GVariantBuilder builder; - GVariant *choices_as_variant; - GError *error = NULL; gboolean res; size_t i; @@ -569,7 +569,6 @@ gdm_session_worker_ask_list_of_choices (GdmSessionWorker *worker, if (! res) { g_debug ("GdmSessionWorker: list request failed: %s", error->message); - g_clear_error (&error); } else { g_debug ("GdmSessionWorker: user selected '%s'", *answerp); } |