Fix potential seg_fault reported in MODEVENT-35

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10869 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Chris Parker 2008-12-18 15:51:48 +00:00
parent 8b85295652
commit e573c86d90
1 changed files with 2 additions and 1 deletions

View File

@ -554,7 +554,8 @@ static switch_status_t my_on_hangup(switch_core_session_t *session)
goto end;
}
}
if (profile->caller_extension && profile->caller_extension->last_application->application_name) {
if (profile->caller_extension && profile->caller_extension->last_application &&
profile->caller_extension->last_application->application_name) {
if (rc_avpair_add(rad_config, &send, PW_FS_LASTAPP,
(void *) profile->caller_extension->last_application->application_name, -1, PW_FS_PEC) == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Freeswitch-Lastapp: %s\n", profile->source);