summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-19 09:16:53 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-19 09:16:53 +0100
commite5e77b67fb6152dd9fb0af3d7410a428299504d3 (patch)
tree9aadec98d43e2e9cda7dce1e082838514ea8bea0
parent6835e7b7f4a20078d508444659c636fc98e680fc (diff)
parenta2e25cf49b24c2012e8e9058ecc7e62f1e027cb3 (diff)
downloadlibnice-e5e77b67fb6152dd9fb0af3d7410a428299504d3.tar.gz
socket: Close base socket for a TCP passive socket when closing parent
Summary: Otherwise the base socket will leak. Spotted by Vadim Genkin. https://phabricator.freedesktop.org/T125 Maniphest Tasks: T125 Reviewers: ocrete Projects: #libnice Reviewed By: ocrete Subscribers: vadimgenkin Differential Revision: https://phabricator.freedesktop.org/D228
-rw-r--r--socket/tcp-passive.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/socket/tcp-passive.c b/socket/tcp-passive.c
index 30bfba8..16fbe3d 100644
--- a/socket/tcp-passive.c
+++ b/socket/tcp-passive.c
@@ -176,6 +176,12 @@ socket_close (NiceSocket *sock)
{
TcpPassivePriv *priv = sock->priv;
+ if (sock->fileno != NULL) {
+ g_socket_close (sock->fileno, NULL);
+ g_object_unref (sock->fileno);
+ sock->fileno = NULL;
+ }
+
if (priv->context)
g_main_context_unref (priv->context);
g_hash_table_unref (priv->connections);