Merge "res_pjsip: Add missing NULL checks when using pjsip_inv_end_session()." into 13

This commit is contained in:
Joshua Colp
2016-07-01 11:15:59 -05:00
committed by Gerrit Code Review
3 changed files with 10 additions and 5 deletions

View File

@@ -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 {

View File

@@ -2619,7 +2619,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);
}
}
@@ -2632,7 +2633,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);
}
}