summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-07-30 17:05:57 -0500
committerRichard Mudgett <rmudgett@digium.com>2015-07-30 17:08:09 -0500
commit13eb491e35ae6a99164dec6a62d7f05784c75c11 (patch)
tree27536a16d225206e1fac987eb5f28ea79a3b5220 /res/res_pjsip_session.c
parent9be856e3c669b65db095dd2cdd618983508de296 (diff)
res_pjsip_session.c: Fix crashes seen when call cancelled.
Two testsuite tests crashed in the same place as a result of an INVITE being CANCELed. tests/channels/pjsip/resolver/srv/failover/in_dialog/transport_unspecified tests/channels/pjsip/resolver/srv/failover/in_dialog/transport_tcp The session pointer is no longer in the inv->mod_data[session_module.id] location because the INVITE transaction has reached the terminated state. ASTERISK-25297 #close Reported by: Richard Mudgett Change-Id: Idb75fdca0321f5447d5dac737a632a5f03614427
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 5eb72b45a..539bfc1fa 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2681,8 +2681,10 @@ static void session_inv_on_media_update(pjsip_inv_session *inv, pj_status_t stat
struct ast_sip_session *session = inv->mod_data[session_module.id];
const pjmedia_sdp_session *local, *remote;
- if (!session->channel) {
- /* If we don't have a channel. We really don't care about media updates.
+ if (!session || !session->channel) {
+ /*
+ * If we don't have a session or channel then we really
+ * don't care about media updates.
* Just ignore
*/
return;