Skip to content

Commit a341d58

Browse files
author
Harald Welte
committed
ftmod_libpri: Fix NULL pointer deref in on_hangup()
1 parent 83f6bf5 commit a341d58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,12 +1405,13 @@ static int on_hangup(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_even
14051405
{
14061406
ftdm_span_t *span = spri->span;
14071407
ftdm_channel_t *chan = ftdm_span_get_channel(span, pevent->hangup.channel);
1408-
ftdm_libpri_b_chan_t *chan_priv = chan->call_data;
1408+
ftdm_libpri_b_chan_t *chan_priv;
14091409

14101410
if (!chan) {
14111411
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);
14121412
return 0;
14131413
}
1414+
chan_priv = chan->call_data;
14141415

14151416
ftdm_channel_lock(chan);
14161417

0 commit comments

Comments
 (0)