summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-10-28 10:41:13 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-10-28 10:43:43 -0500
commitc2b8fa8a34765d42be69e7eb9a4c44eeb970f775 (patch)
treebbac499005fbc5ea568ad9637607f7b573a0d494
parent35ffbf953d50e922b522dd478e9d623cccea3378 (diff)
downloadglib-mcatanzaro/#2233.tar.gz
gsocketclient: fix crash when async connection step failsmcatanzaro/#2233
This is a regression from !1686. The tmp_error is no longer valid after it is "considered" and cannot be used at this point. We should print the error earlier instead. Fixes #2233
-rw-r--r--gio/gsocketclient.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
index ce3c186fb..373774682 100644
--- a/gio/gsocketclient.c
+++ b/gio/gsocketclient.c
@@ -1837,9 +1837,9 @@ g_socket_client_connected_callback (GObject *source,
{
if (!g_cancellable_is_cancelled (attempt->cancellable))
{
+ g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message);
clarify_connect_error (data->error_info->tmp_error, data->connectable, attempt->address);
consider_tmp_error (data->error_info, G_SOCKET_CLIENT_CONNECTING);
- g_debug ("GSocketClient: Connection attempt failed: %s", data->error_info->tmp_error->message);
connection_attempt_remove (attempt);
connection_attempt_unref (attempt);
try_next_connection_or_finish (data, FALSE);