summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2020-10-26 10:54:37 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2020-10-26 10:54:37 -0400
commit804a4c095ff689939e2f21fbede5f1ced18667a6 (patch)
treec0ee40a6381158229a0689c480bc021ca9f36b6a
parentf36cf5b65a0fc96d3bdedf8db308477d3f6e4d48 (diff)
downloadlibnice-804a4c095ff689939e2f21fbede5f1ced18667a6.tar.gz
component: Fix potential NULL deference
This was introduced recently and flagged by Coverity.
-rw-r--r--agent/component.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/component.c b/agent/component.c
index 1854779..506d784 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -197,7 +197,8 @@ nice_component_remove_socket (NiceAgent *agent, NiceComponent *cmp,
conn_check_prune_socket (agent, stream, cmp, candidate->sockptr);
nice_component_detach_socket (cmp, candidate->sockptr);
}
- agent_remove_local_candidate (agent, stream, (NiceCandidate *) candidate);
+ if (stream)
+ agent_remove_local_candidate (agent, stream, (NiceCandidate *) candidate);
nice_candidate_free ((NiceCandidate *)candidate);
cmp->local_candidates = g_slist_delete_link (cmp->local_candidates, i);