summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-29 20:04:03 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-29 20:04:03 +0100
commit1c34734cd105c6cca0ec8bbb908002c4bfb007b3 (patch)
tree5f75647da3b5f45ed99873a23b18ea330ed2b77c
parentdddca10ceff20e3578fc901b9919c3d20f87b7b6 (diff)
downloadlibnice-1c34734cd105c6cca0ec8bbb908002c4bfb007b3.tar.gz
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
-rw-r--r--agent/agent.c3
1 files changed, 2 insertions, 1 deletions
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;
}