From bdefe5f9e1eb739043ae19ac57fb00e905f482e2 Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Thu, 9 May 2019 12:21:52 +0200 Subject: [PATCH] gsocketclient: Fix a leak in the connection code We miss releasing the async operation's reference on a state object in one of the error cases. The call to connection_attempt_remove() (although it calls unref internally) is not sufficient because this is releasing the reference that the list owns. Closes #1774 --- gio/gsocketclient.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c index 5faa02ecb..59af25abf 100644 --- a/gio/gsocketclient.c +++ b/gio/gsocketclient.c @@ -1616,6 +1616,7 @@ g_socket_client_connected_callback (GObject *source, set_last_error (data, error); connection_attempt_remove (attempt); enumerator_next_async (data, FALSE); + connection_attempt_unref (attempt); } else {