[Freeswitch-svn] [commit] r8633 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta

Freeswitch SVN mikej at freeswitch.org
Sun May 25 11:19:58 EDT 2008


Author: mikej
Date: Sun May 25 11:19:57 2008
New Revision: 8633

Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c

Log:
Thu May 22 09:39:19 EDT 2008  Pekka.Pessi at nokia.com
  * nta.c: fixed klocwork issues



Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Sun May 25 11:19:57 2008
@@ -1 +1 @@
-Sun May 25 11:18:13 EDT 2008
+Sun May 25 11:19:51 EDT 2008

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c	Sun May 25 11:19:57 2008
@@ -3310,7 +3310,7 @@
   url_t reg_url[1];
   url_string_t const *original = request_uri;
 
-  if (!leg || !msg)
+  if (!leg || !msg || !sip)
     return -1;
 
   if (!sip->sip_route && leg->leg_route) {
@@ -4722,7 +4722,7 @@
       irq->irq_record_route = 
 	sip_record_route_copy(home, sip->sip_record_route);
     }
-    irq->irq_branch  = irq->irq_via->v_branch;
+    irq->irq_branch  = sip->sip_via->v_branch;
     irq->irq_reliable_tp = tport_is_reliable(tport);
 
     if (sip->sip_timestamp)
@@ -5822,7 +5822,7 @@
     msg = nta_msg_create(irq->irq_agent, 0);
     sip = sip_object(msg);
 
-    if (status != 0)
+    if (sip && status != 0)
       sip->sip_status = sip_status_create(msg_home(msg), status, phrase, NULL);
 
     if (nta_incoming_response_headers(irq, msg, sip) < 0)
@@ -5905,7 +5905,7 @@
     return -1;
   }
 
-  if (msg == NULL)
+  if (msg == NULL || sip == NULL)
     return -1;
 
   if (msg == irq->irq_response)
@@ -8403,6 +8403,8 @@
   if (!internal && orq->orq_delay == UINT_MAX)
     outgoing_estimate_delay(orq, sip);
 
+  assert(!internal || status >= 300);
+
   if (orq->orq_cc)
     agent_accept_compressed(orq->orq_agent, msg, orq->orq_cc);
 
@@ -9549,6 +9551,9 @@
     rlen = strlen(na->na_replace) + 1;
     sq = su_zalloc(home, (sizeof *sq) + rlen);
 
+    if (sq == NULL)
+      continue;
+
     *tail = sq, tail = &sq->sq_next;    
     sq->sq_otype = sres_type_naptr;
     sq->sq_priority = na->na_prefer;



More information about the Freeswitch-svn mailing list