From 804a4c095ff689939e2f21fbede5f1ced18667a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 26 Oct 2020 10:54:37 -0400 Subject: component: Fix potential NULL deference This was introduced recently and flagged by Coverity. --- agent/component.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1