Commit 6f5dd4a3 authored by Olivier Crête's avatar Olivier Crête 👻

agent: Remove useless checks from nice_agent_add_stream

parent 2ea8108c
......@@ -1439,15 +1439,13 @@ nice_agent_add_stream (
guint n_components)
{
Stream *stream;
GSList *modified_list = NULL;
guint ret = 0;
guint i;
agent_lock();
stream = stream_new (n_components);
if (stream) {
modified_list = g_slist_append (agent->streams, stream);
if (modified_list) {
agent->streams = g_slist_append (agent->streams, stream);
stream->id = agent->next_stream_id++;
nice_debug ("Agent %p : allocating stream id %u (%p)", agent, stream->id, stream);
if (agent->reliable) {
......@@ -1477,11 +1475,6 @@ nice_agent_add_stream (
}
stream_initialize_credentials (stream, agent->rng);
agent->streams = modified_list;
}
else
stream_free (stream);
}
ret = stream->id;
......
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