From 1c34734cd105c6cca0ec8bbb908002c4bfb007b3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Sat, 29 Aug 2015 20:04:03 +0100 Subject: Fix agent leak in case component socket is reset remotely Summary: The patch fixes the issue where agent reference count is not properly decremented causing instance leak in cases where component's socket is reset remotely. Reviewers: #libnice, pwithnall Projects: #libnice Reviewed By: #libnice, pwithnall Subscribers: pwithnall, maximgolunov Differential Revision: https://phabricator.freedesktop.org/D236 --- agent/agent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/agent.c b/agent/agent.c index 77450c3..09945f1 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -1700,7 +1700,6 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data) out: g_object_unref (agent); - } static void @@ -4775,6 +4774,7 @@ component_io_cb (GSocket *gsocket, GIOCondition condition, gpointer user_data) component_detach_socket (component, socket_source->socket); agent_unlock (); + g_object_unref (agent); return G_SOURCE_REMOVE; } @@ -4945,6 +4945,7 @@ done: out: g_object_unref (agent); + agent_unlock_and_emit (agent); return G_SOURCE_REMOVE; } -- cgit v1.2.1