gsocketclient: Fix a leak of the task data on an error path

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 <pwithnall@gnome.org>

Fixes: #3184
This commit is contained in:
Philip Withnall 2023-11-22 11:14:56 +00:00
parent 0043895879
commit 1942dd5b5c
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -1919,6 +1919,7 @@ try_next_connection_or_finish (GSocketClientAsyncConnectData *data,
} }
complete_connection_with_error (data, g_steal_pointer (&data->error_info->best_error)); complete_connection_with_error (data, g_steal_pointer (&data->error_info->best_error));
g_object_unref (data->task);
} }
static void static void