Commit 39ae272b authored by Olivier Crête's avatar Olivier Crête

agent: Avoid leak on programming error

Even if the agent is invalid, don't leak.

This makes coverity a little happier.
parent 86a7499f
...@@ -6676,11 +6676,13 @@ _generate_stream_sdp (NiceAgent *agent, NiceStream *stream, ...@@ -6676,11 +6676,13 @@ _generate_stream_sdp (NiceAgent *agent, NiceStream *stream,
NICEAPI_EXPORT gchar * NICEAPI_EXPORT gchar *
nice_agent_generate_local_sdp (NiceAgent *agent) nice_agent_generate_local_sdp (NiceAgent *agent)
{ {
GString * sdp = g_string_new (NULL); GString *sdp;
GSList *i; GSList *i;
g_return_val_if_fail (NICE_IS_AGENT (agent), NULL); g_return_val_if_fail (NICE_IS_AGENT (agent), NULL);
sdp = g_string_new (NULL);
agent_lock (agent); agent_lock (agent);
for (i = agent->streams; i; i = i->next) { for (i = agent->streams; i; i = i->next) {
......
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