summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-07-01 11:36:42 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-07-01 11:36:42 -0500
commit082f3d123c3e51919c2fd01e76d3aa148020e4ba (patch)
treee1225a13d298eecc1bd7e0fe108391073b799d2c /res
parent0bfa3f01414ff194df4cd4f7c23c7f4e2c2fc902 (diff)
parent656ed73ac686f2e7d4afcbd46a4a04086a3502c6 (diff)
Merge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()."
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_refer.c3
-rw-r--r--res/res_pjsip_session.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index df5425179..1043a1e24 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -969,7 +969,8 @@ inv_replace_failed:
session->defer_terminate = 1;
ast_hangup(session->channel);
- if (pjsip_inv_end_session(session->inv_session, response, NULL, &packet) == PJ_SUCCESS) {
+ if (pjsip_inv_end_session(session->inv_session, response, NULL, &packet) == PJ_SUCCESS
+ && packet) {
ast_sip_session_send_response(session, packet);
}
} else {
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index eb9551097..6287c17ec 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2651,7 +2651,8 @@ static void session_inv_on_tsx_state_changed(pjsip_inv_session *inv, pjsip_trans
}
if (tsx->status_code != 488) {
/* Other reinvite failures (except 488) result in destroying the session. */
- if (pjsip_inv_end_session(inv, 500, NULL, &tdata) == PJ_SUCCESS) {
+ if (pjsip_inv_end_session(inv, 500, NULL, &tdata) == PJ_SUCCESS
+ && tdata) {
ast_sip_session_send_request(session, tdata);
}
}
@@ -2664,7 +2665,8 @@ static void session_inv_on_tsx_state_changed(pjsip_inv_session *inv, pjsip_trans
* a cancelled call. Our role is to immediately send a BYE to end the
* dialog.
*/
- if (pjsip_inv_end_session(inv, 500, NULL, &tdata) == PJ_SUCCESS) {
+ if (pjsip_inv_end_session(inv, 500, NULL, &tdata) == PJ_SUCCESS
+ && tdata) {
ast_sip_session_send_request(session, tdata);
}
}