summaryrefslogtreecommitdiff
path: root/agent/conncheck.c
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-07-06 13:53:44 +0200
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2021-04-20 14:07:39 +0000
commit48dac0d702b134f7b11b92602c234ba1120cc75b (patch)
treefd802f13c9b9cea1ed0e0d92d0e772c3656fc338 /agent/conncheck.c
parente1a841356d227a15a32477b18186df036dd3c479 (diff)
downloadlibnice-48dac0d702b134f7b11b92602c234ba1120cc75b.tar.gz
agent: keep a track of the candidate refreshes being pruned
Refreshes with zero lifetime sent over tcp transport may cause the removal of the underlying socket when the remote peer closes the connection taking our request into account. These refreshes must be tracked and freeed on our side to avoid retransmission attempt on a closed socket and a heap-use-after-free error in that case.
Diffstat (limited to 'agent/conncheck.c')
-rw-r--r--agent/conncheck.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 689ec48..39ef78f 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -3855,6 +3855,7 @@ priv_add_new_turn_refresh (NiceAgent *agent, CandidateDiscovery *cdisco,
nice_debug ("timer source is : %p", cand->timer_source);
} else {
+ agent->pruning_refreshes = g_slist_append (agent->pruning_refreshes, cand);
nice_debug ("Agent %p : Sending request to remove TURN allocation "
"for refresh %p", agent, cand);
cand->disposing = TRUE;