]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
adding safe check for term ptr
authorKapil <kgupta@sangoma.com>
Tue, 31 Jul 2012 13:26:46 +0000 (09:26 -0400)
committerKapil <kgupta@sangoma.com>
Tue, 31 Jul 2012 13:26:46 +0000 (09:26 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway_utils.c

index b4b3663fa45412316c0338f93b7b65c2aa65046f..1f883a6740d79ee2ba979038da2b590560f4b62d 100644 (file)
@@ -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;