From 7421bcfb3431ebe3c60b5e08e7482a598230b5c3 Mon Sep 17 00:00:00 2001 From: Kapil Date: Tue, 31 Jul 2012 09:26:46 -0400 Subject: [PATCH] adding safe check for term ptr --- src/mod/endpoints/mod_media_gateway/media_gateway_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_media_gateway/media_gateway_utils.c b/src/mod/endpoints/mod_media_gateway/media_gateway_utils.c index b4b3663fa4..1f883a6740 100644 --- a/src/mod/endpoints/mod_media_gateway/media_gateway_utils.c +++ b/src/mod/endpoints/mod_media_gateway/media_gateway_utils.c @@ -85,7 +85,7 @@ switch_status_t mg_stack_termination_is_in_service(megaco_profile_t* mg_profile, { mg_termination_t* term = NULL; term = megaco_find_termination(mg_profile, term_str); - if(switch_test_flag(term, MG_IN_SERVICE)){ + if(term && switch_test_flag(term, MG_IN_SERVICE)){ return SWITCH_STATUS_SUCCESS; } else { return SWITCH_STATUS_FALSE;