Commit d42fdea1 authored by Olivier Crête's avatar Olivier Crête

Remove useless check on g_slist_remove (it doesnt allocate anything!)

parent 3782e8c3
...@@ -105,29 +105,20 @@ void discovery_free (NiceAgent *agent) ...@@ -105,29 +105,20 @@ void discovery_free (NiceAgent *agent)
*/ */
gboolean discovery_prune_stream (NiceAgent *agent, guint stream_id) gboolean discovery_prune_stream (NiceAgent *agent, guint stream_id)
{ {
CandidateDiscovery *cand;
GSList *i; GSList *i;
for (i = agent->discovery_list; i ; ) { for (i = agent->discovery_list; i ; ) {
cand = i->data; CandidateDiscovery *cand = i->data;
GSList *next = i->next;
if (cand->stream->id == stream_id) { if (cand->stream->id == stream_id) {
GSList *next = i->next; agent->discovery_list = g_slist_remove (agent->discovery_list, cand);
agent->discovery_list =
g_slist_remove (agent->discovery_list, cand);
discovery_free_item (cand, NULL); discovery_free_item (cand, NULL);
i = next;
if (!agent->discovery_list)
break;
} }
else i = next;
i = i->next;
} }
if (agent->discovery_list == NULL) { if (agent->discovery_list == NULL) {
/* return FALSE if there was a memory allocation failure */
if (i != NULL)
return FALSE;
/* noone using the timer anymore, clean it up */ /* noone using the timer anymore, clean it up */
discovery_free (agent); discovery_free (agent);
} }
......
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