g_socket_client_connect_async() was always leaking its GCancellable,
and would also leak any GSocket that eventually failed to connect
after returning G_IO_ERROR_PENDING.
g_simple_async_result_complete (data->result);
g_object_unref (data->result);
g_object_unref (data->enumerator);
+ if (data->cancellable)
+ g_object_unref (data->cancellable);
g_slice_free (GSocketClientAsyncConnectData, data);
}
if (!g_socket_check_connect_result (data->current_socket, &error))
{
set_last_error (data, error);
+ g_object_unref (data->current_socket);
+ data->current_socket = NULL;
/* try next one */
g_socket_address_enumerator_next_async (data->enumerator,