freetdm: Fix uninitialized var leading to segfault

This commit is contained in:
Moises Silva 2012-01-27 06:34:36 -05:00
parent a83f04ab6a
commit 2db41c5c79
1 changed files with 2 additions and 1 deletions

View File

@ -1267,6 +1267,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
ftdm_usrmsg_t usrmsg; ftdm_usrmsg_t usrmsg;
memset(&usrmsg, 0, sizeof(ftdm_usrmsg_t)); memset(&usrmsg, 0, sizeof(ftdm_usrmsg_t));
memset(sigbridge_peer, 0, sizeof(sigbridge_peer));
if (!outbound_profile) { if (!outbound_profile) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing caller profile\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing caller profile\n");
@ -1655,7 +1656,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
ftdm_channel_get_span_id(peer_pvt->ftdmchan), ftdm_channel_get_id(peer_pvt->ftdmchan)); ftdm_channel_get_span_id(peer_pvt->ftdmchan), ftdm_channel_get_id(peer_pvt->ftdmchan));
} }
if (!zstr(sigbridge_peer)) { if (session && !zstr(sigbridge_peer)) {
peer_chan = switch_core_session_get_channel(session); peer_chan = switch_core_session_get_channel(session);
ftdm_usrmsg_add_var(&usrmsg, "sigbridge_peer", sigbridge_peer); ftdm_usrmsg_add_var(&usrmsg, "sigbridge_peer", sigbridge_peer);
} }