summaryrefslogtreecommitdiff
path: root/agent/component.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-01 00:00:30 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-09 16:26:07 -0400
commit375cde8a652f8e367cf875bcb718a6d1abcfb254 (patch)
tree541a53bb227af0d5199b6367691dfbc593792a1a /agent/component.c
parent838c5cb5a73398e8134a13210714a317abfbcf20 (diff)
downloadlibnice-375cde8a652f8e367cf875bcb718a6d1abcfb254.tar.gz
agent: Avoid leaking UPnP mappings between streams
Clean up the UPnP mappings of each stream when closing it
Diffstat (limited to 'agent/component.c')
-rw-r--r--agent/component.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/agent/component.c b/agent/component.c
index 539d387..c6a5601 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -200,6 +200,7 @@ component_clean_turn_servers (Component *cmp)
conn_check_prune_socket (cmp->agent, cmp->stream, cmp,
candidate->sockptr);
component_detach_socket (cmp, candidate->sockptr);
+ agent_remove_local_candidate (cmp->agent, candidate);
nice_candidate_free (candidate);
}
cmp->local_candidates = g_slist_delete_link (cmp->local_candidates, i);
@@ -235,9 +236,13 @@ component_close (Component *cmp)
nice_candidate_free (cmp->turn_candidate),
cmp->turn_candidate = NULL;
- g_slist_free_full (cmp->local_candidates,
- (GDestroyNotify) nice_candidate_free);
- cmp->local_candidates = NULL;
+ while (cmp->local_candidates) {
+ agent_remove_local_candidate (cmp->agent, cmp->local_candidates->data);
+ nice_candidate_free (cmp->local_candidates->data);
+ cmp->local_candidates = g_slist_delete_link (cmp->local_candidates,
+ cmp->local_candidates);
+ }
+
g_slist_free_full (cmp->remote_candidates,
(GDestroyNotify) nice_candidate_free);
cmp->remote_candidates = NULL;