[farsight2/master] Only try to add base_addr if it is valid

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:25 PST 2008


---
 transmitters/nice/fs-nice-stream-transmitter.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 14c849f..a9f7acf 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -788,10 +788,17 @@ nice_candidate_to_fs_candidate (NiceAgent *agent, NiceCandidate *nicecandidate)
       ipaddr,
       nice_address_get_port (&nicecandidate->addr));
 
-  nice_address_to_string (&nicecandidate->base_addr, ipaddr);
-
-  fscandidate->base_ip = ipaddr;
-  fscandidate->base_port = nice_address_get_port (&nicecandidate->base_addr);
+  if (nice_address_is_valid (&nicecandidate->base_addr))
+  {
+    nice_address_to_string (&nicecandidate->base_addr, ipaddr);
+    fscandidate->base_ip = ipaddr;
+    fscandidate->base_port = nice_address_get_port (&nicecandidate->base_addr);
+  }
+  else
+  {
+    g_free (ipaddr);
+    ipaddr = NULL;
+  }
 
   fscandidate->username = g_strdup (nicecandidate->username);
   fscandidate->password = g_strdup (nicecandidate->password);
-- 
1.5.6.5




More information about the farsight-commits mailing list