agent: Don't ask upnp to remove not yet allocated candidates
authorOlivier Crête <olivier.crete@collabora.com>
Tue, 21 Jun 2016 20:41:50 +0000 (16:41 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Tue, 21 Jun 2016 20:41:50 +0000 (16:41 -0400)
This caused a warning in Farstream tests.

agent/agent.c

index 08a2387..d819d27 100644 (file)
@@ -2965,6 +2965,9 @@ void agent_remove_local_candidate (NiceAgent *agent, NiceCandidate *candidate)
   if (candidate->type != NICE_CANDIDATE_TYPE_HOST)
     return;
 
+  if (nice_address_get_port (&candidate->addr) == 0)
+    return;
+
   nice_address_to_string (&candidate->addr, local_ip);
 
   gupnp_simple_igd_remove_port_local (GUPNP_SIMPLE_IGD (agent->upnp), "UDP",