summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBiagioFesta <15035284+BiagioFesta@users.noreply.github.com>2022-12-13 17:07:24 +0100
committerBiagioFesta <15035284+BiagioFesta@users.noreply.github.com>2022-12-13 18:40:59 +0100
commit6308303e29bbd09966e431cde2df55b879b8df92 (patch)
tree3a92e5fd392227e9264d74b7bd8c57ab0a10fea4
parentefc5efba6db6478a5fcb8c938ef0dcd10b35b136 (diff)
downloadlibsoup-6308303e29bbd09966e431cde2df55b879b8df92.tar.gz
server-connection: fix dep cycle and connection leak
The initial message contains a cycle-reference to the connection. We need to decrement the reference in order to properly clean up the connection. Before this patch, it was possible SoupServerConnection-finalize was never called. This was causing a memory leak (and socket FD leak).
-rw-r--r--libsoup/server/soup-server-connection.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libsoup/server/soup-server-connection.c b/libsoup/server/soup-server-connection.c
index ccd8cb57..cac4eaa7 100644
--- a/libsoup/server/soup-server-connection.c
+++ b/libsoup/server/soup-server-connection.c
@@ -98,6 +98,7 @@ disconnect_internal (SoupServerConnection *conn)
g_io_stream_close (priv->conn, NULL, NULL);
g_signal_handlers_disconnect_by_data (priv->conn, conn);
g_clear_object (&priv->conn);
+ g_clear_object (&priv->initial_msg);
g_clear_pointer (&priv->io_data, soup_server_message_io_destroy);
}