From 1942dd5b5c91fdab96e7c102a3f73a4190035e19 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 22 Nov 2023 11:14:56 +0000 Subject: [PATCH] gsocketclient: Fix a leak of the task data on an error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once the task is completed (and `g_task_return_*()` has been called), the task is no longer needed. It would make more sense to unref it in `complete_connection_with_error()`, where `g_task_return_*()` is called, but that complicates other call sites significantly, so I didn’t do it. Signed-off-by: Philip Withnall Fixes: #3184 --- gio/gsocketclient.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c index d4231599a..f684986fb 100644 --- a/gio/gsocketclient.c +++ b/gio/gsocketclient.c @@ -1919,6 +1919,7 @@ try_next_connection_or_finish (GSocketClientAsyncConnectData *data, } complete_connection_with_error (data, g_steal_pointer (&data->error_info->best_error)); + g_object_unref (data->task); } static void