summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-18 14:58:23 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-08-18 14:58:23 +0100
commita2e25cf49b24c2012e8e9058ecc7e62f1e027cb3 (patch)
tree9aadec98d43e2e9cda7dce1e082838514ea8bea0
parent6835e7b7f4a20078d508444659c636fc98e680fc (diff)
downloadlibnice-a2e25cf49b24c2012e8e9058ecc7e62f1e027cb3.tar.gz
socket: Close base socket for a TCP passive socket when closing parent
Otherwise the base socket will leak. Spotted by Vadim Genkin. https://phabricator.freedesktop.org/T125
-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);