Commit bbe144bb authored by Dafydd Harries's avatar Dafydd Harries

fix memory leak in nice_agent_remove_stream

darcs-hash:20070213150802-c9803-653657281a3ac8ef33f0c38664c400e54e3b0036.gz
parent 54f62193
......@@ -369,17 +369,29 @@ nice_agent_remove_stream (
{
GSList *i;
GSList *old_list = agent->local_candidates;
GSList *free_list = NULL;
GSList *new_list = NULL;
for (i = agent->local_candidates; i; i = i->next)
{
NiceCandidate *candidate = i->data;
if (candidate->stream_id != stream_id)
if (candidate->stream_id == stream_id)
free_list = g_slist_append (free_list, candidate);
else
new_list = g_slist_append (new_list, candidate);
}
agent->local_candidates = new_list;
for (i = free_list; i; i = i->next)
{
NiceCandidate *candidate = i->data;
nice_candidate_free (candidate);
}
g_slist_free (free_list);
g_slist_free (old_list);
}
......
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