Skip to content
Permalink
Browse files

ftmod_libpri: Fix NULL pointer deref in on_hangup()

  • Loading branch information
Harald Welte
Harald Welte committed Dec 28, 2019
1 parent 83f6bf5 commit a341d58fbdf6b8bd7d1dd9509dc5319bee206168
Showing with 2 additions and 1 deletion.
  1. +2 −1 libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c
@@ -1405,12 +1405,13 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
{
ftdm_span_t *span = spri->span;
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->hangup.channel);
ftdm_libpri_b_chan_t *chan_priv = chan->call_data;
ftdm_libpri_b_chan_t *chan_priv;

if (!chan) {
ftdm_log(FTDM_LOG_CRIT, "-- Hangup on channel %d:%d but it's not in use?\n", ftdm_span_get_id(spri->span), pevent->hangup.channel);
return 0;
}
chan_priv = chan->call_data;

ftdm_channel_lock(chan);

0 comments on commit a341d58

Please sign in to comment.
You can’t perform that action at this time.