Skip to content

agent: Fix use of freed stream in nice_agent_dispose()

Jakub Adam requested to merge xhaakon/libnice:fix-agent-dispose into master

nice_stream_close() calls agent_find_stream(), which iterates over agent->streams list.

Therefore, when we're freeing agent->streams in a loop, we must also delete the respective GSList item from the list at the end of each iteration. Otherwise agent_find_stream() would stumble over already deleted NiceStream instance the next time it gets called.

Fixes random crashes when running test-different-number-streams on Windows.

Merge request reports