Commit 3d5cf929 authored by Youness Alaoui's avatar Youness Alaoui
Browse files

Make sure that we revert/free the candidates gathered before an error occured if we can't gather

parent 5d3c509b
......@@ -1871,6 +1871,20 @@ nice_agent_gather_candidates (
nice_address_free (i->data);
g_slist_free (local_addresses);
if (ret == FALSE) {
priv_free_upnp (agent);
for (n = 0; n < stream->n_components; n++) {
Component *component = stream_find_component_by_id (stream, n + 1);
for (i = component->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
nice_candidate_free (candidate);
}
g_slist_free (component->local_candidates);
component->local_candidates = NULL;
}
discovery_prune_stream (agent, stream_id);
}
agent_unlock();
return ret;
......
Supports Markdown
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