From 05d4e8df4d6b13628230fc69af143843a06e6839 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 5 Dec 2012 10:40:56 +0000 Subject: Misc (re #1562): Add a protection in med_tp_timer_cb() against call that may have been terminated before ICE callback is called. It has been reported that this has caused a crash, but we cannot reproduce it. Thanks Karina for the report. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4305 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_media.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pjsip') diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 58dc441e..abfeea7d 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -570,7 +570,12 @@ static void med_tp_timer_cb(void *user_data) pjsua_call *call = NULL; pjsip_dialog *dlg = NULL; - acquire_call("med_tp_timer_cb", call_med->call->index, &call, &dlg); + if (acquire_call("med_tp_timer_cb", call_med->call->index, + &call, &dlg) != PJ_SUCCESS) + { + /* Call have been terminated */ + return; + } (*call_med->med_create_cb)(call_med, call_med->tp_ready, call_med->call->secure_level, NULL); -- cgit v1.2.3