[glib: 1/2] gsocketclient: Fix a leak in the connection code



commit bdefe5f9e1eb739043ae19ac57fb00e905f482e2
Author: Allison Karlitskaya <allison karlitskaya redhat com>
Date:   Thu May 9 12:21:52 2019 +0200

    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
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]