提交 abce217f authored 作者: Michael Jerris's avatar Michael Jerris

Thu May 22 09:39:19 EDT 2008 Pekka.Pessi@nokia.com

  * nta.c: fixed klocwork issues



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8633 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 d9d3d80f
Sun May 25 11:18:13 EDT 2008 Sun May 25 11:19:51 EDT 2008
...@@ -3310,7 +3310,7 @@ int nta_msg_request_complete(msg_t *msg, ...@@ -3310,7 +3310,7 @@ int nta_msg_request_complete(msg_t *msg,
url_t reg_url[1]; url_t reg_url[1];
url_string_t const *original = request_uri; url_string_t const *original = request_uri;
if (!leg || !msg) if (!leg || !msg || !sip)
return -1; return -1;
if (!sip->sip_route && leg->leg_route) { if (!sip->sip_route && leg->leg_route) {
...@@ -4722,7 +4722,7 @@ nta_incoming_t *incoming_create(nta_agent_t *agent, ...@@ -4722,7 +4722,7 @@ nta_incoming_t *incoming_create(nta_agent_t *agent,
irq->irq_record_route = irq->irq_record_route =
sip_record_route_copy(home, sip->sip_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); irq->irq_reliable_tp = tport_is_reliable(tport);
if (sip->sip_timestamp) if (sip->sip_timestamp)
...@@ -5822,7 +5822,7 @@ msg_t *nta_incoming_create_response(nta_incoming_t *irq, ...@@ -5822,7 +5822,7 @@ msg_t *nta_incoming_create_response(nta_incoming_t *irq,
msg = nta_msg_create(irq->irq_agent, 0); msg = nta_msg_create(irq->irq_agent, 0);
sip = sip_object(msg); sip = sip_object(msg);
if (status != 0) if (sip && status != 0)
sip->sip_status = sip_status_create(msg_home(msg), status, phrase, NULL); sip->sip_status = sip_status_create(msg_home(msg), status, phrase, NULL);
if (nta_incoming_response_headers(irq, msg, sip) < 0) if (nta_incoming_response_headers(irq, msg, sip) < 0)
...@@ -5905,7 +5905,7 @@ int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg) ...@@ -5905,7 +5905,7 @@ int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg)
return -1; return -1;
} }
if (msg == NULL) if (msg == NULL || sip == NULL)
return -1; return -1;
if (msg == irq->irq_response) if (msg == irq->irq_response)
...@@ -8403,6 +8403,8 @@ int outgoing_recv(nta_outgoing_t *orq, ...@@ -8403,6 +8403,8 @@ int outgoing_recv(nta_outgoing_t *orq,
if (!internal && orq->orq_delay == UINT_MAX) if (!internal && orq->orq_delay == UINT_MAX)
outgoing_estimate_delay(orq, sip); outgoing_estimate_delay(orq, sip);
assert(!internal || status >= 300);
if (orq->orq_cc) if (orq->orq_cc)
agent_accept_compressed(orq->orq_agent, msg, orq->orq_cc); agent_accept_compressed(orq->orq_agent, msg, orq->orq_cc);
...@@ -9549,6 +9551,9 @@ void outgoing_answer_naptr(sres_context_t *orq, ...@@ -9549,6 +9551,9 @@ void outgoing_answer_naptr(sres_context_t *orq,
rlen = strlen(na->na_replace) + 1; rlen = strlen(na->na_replace) + 1;
sq = su_zalloc(home, (sizeof *sq) + rlen); sq = su_zalloc(home, (sizeof *sq) + rlen);
if (sq == NULL)
continue;
*tail = sq, tail = &sq->sq_next; *tail = sq, tail = &sq->sq_next;
sq->sq_otype = sres_type_naptr; sq->sq_otype = sres_type_naptr;
sq->sq_priority = na->na_prefer; sq->sq_priority = na->na_prefer;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论