From: Kapil Gupta Date: Thu, 23 Aug 2012 14:40:48 +0000 (-0400) Subject: error scenario , releasing context and setting null to term->context ptr X-Git-Tag: v1.2.3^2~71^2^2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e0b7175f13e9050a3d56dc0064c0c37cca06d1;p=thirdparty%2Ffreeswitch.git error scenario , releasing context and setting null to term->context ptr --- diff --git a/src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c b/src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c index a1712fc672..e45fc1cda8 100644 --- a/src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c +++ b/src/mod/endpoints/mod_media_gateway/media_gateway_cmd_handler.c @@ -1047,6 +1047,10 @@ error: if(err_code != MGT_MGCO_RSP_CODE_DUP_TERM_CTXT){ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR," ADD Request failed..releasing context/termination(if allocated) \n"); if(mg_ctxt){ + /* we can call sub all from context api to release terminations.. + as it could possible that phy term added to context but + failure happened while adding rtp term, sub_all will release phy term also */ + megaco_context_sub_all_termination(mg_ctxt); megaco_release_context(mg_ctxt); } if(term){