res_pjsip: Add missing NULL checks when using pjsip_inv_end_session().

pjsip_inv_end_session() is documented as being able to return the
passed in tdata parameter set to NULL on success.

Change-Id: I09d53725c49b7183c41bfa1be3ff225f3a8d3047
This commit is contained in:
Richard Mudgett
2016-06-22 18:02:59 -05:00
parent 5ad7e1c09a
commit 656ed73ac6
3 changed files with 10 additions and 5 deletions

View File

@@ -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);
}
}