summaryrefslogtreecommitdiff
path: root/socket
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2016-02-29 16:11:18 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-05-26 16:08:35 -0400
commit8ee6d1bbed87fda37ade7b5c5d9483f41037b06a (patch)
treef317ffb25460bb56822c455fadd04f3a550a4128 /socket
parent8f1f615e92cd56ad4d8487457c2fde2c4aaa51d9 (diff)
downloadlibnice-8ee6d1bbed87fda37ade7b5c5d9483f41037b06a.tar.gz
udp-turn: Fix binding timeout leak
Diffstat (limited to 'socket')
-rw-r--r--socket/udp-turn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/socket/udp-turn.c b/socket/udp-turn.c
index da43b19..d0e20b2 100644
--- a/socket/udp-turn.c
+++ b/socket/udp-turn.c
@@ -1098,6 +1098,13 @@ priv_binding_timeout (gpointer data)
ChannelBinding *b = i->data;
if (b->timeout_source == source) {
b->renew = TRUE;
+
+ /* Remove any existing timer */
+ if (b->timeout_source) {
+ g_source_destroy (b->timeout_source);
+ g_source_unref (b->timeout_source);
+ }
+
/* Install timer to expire the permission */
b->timeout_source = priv_timeout_add_with_context (priv,
STUN_EXPIRE_TIMEOUT, TRUE, priv_binding_expired_timeout, priv);