From 4dd1582625c8067b2010b374298f89e3f67ac6a8 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Sat, 9 Feb 2019 10:24:13 -0500 Subject: [PATCH] gsocketclient: Ensure task is always returned on cancel It was possible for the individual connection attempts to be cancelled without the main task getting returned. Fixes libsoup#132 --- gio/gsocketclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c index 29a5e5598..11e92e909 100644 --- a/gio/gsocketclient.c +++ b/gio/gsocketclient.c @@ -1567,7 +1567,7 @@ g_socket_client_connected_callback (GObject *source, GProxy *proxy; const gchar *protocol; - if (g_cancellable_is_cancelled (attempt->cancellable) || task_completed_or_cancelled (data->task)) + if (task_completed_or_cancelled (data->task) || g_cancellable_is_cancelled (attempt->cancellable)) { g_object_unref (data->task); connection_attempt_unref (attempt);