Commit 30a0c230 authored by Olivier Crête's avatar Olivier Crête

conncheck: Remove pairs before freeing candidate

Remove the whole pair before the candidate is
to be freed.

https://phabricator.freedesktop.org/T7460
parent 71f7ed3e
......@@ -3671,8 +3671,9 @@ conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *co
}
/* Prune from the candidate check pairs. */
for (l = stream->conncheck_list; l != NULL; l = l->next) {
for (l = stream->conncheck_list; l != NULL;) {
CandidateCheckPair *p = l->data;
GSList *next = l->next;
if ((p->local != NULL && p->local->sockptr == sock) ||
(p->remote != NULL && p->remote->sockptr == sock) ||
......@@ -3680,6 +3681,10 @@ conn_check_prune_socket (NiceAgent *agent, NiceStream *stream, NiceComponent *co
nice_debug ("Agent %p : Retransmissions failed, giving up on "
"connectivity check %p", agent, p);
candidate_check_pair_fail (stream, agent, p);
conn_check_free_item (p);
stream->conncheck_list = g_slist_delete_link (stream->conncheck_list, l);
}
l = next;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment