AMPS: Fix 'use-after-free-bug' after destroying transaction

This commit is contained in:
Andreas Eversberg
2017-09-24 14:11:54 +02:00
parent b6468b585d
commit c1fe179d5d

View File

@@ -699,11 +699,9 @@ void amps_rx_signaling_tone(amps_t *amps, int tone, double quality)
if (!tone) if (!tone)
break; break;
timer_stop(&trans->timer); timer_stop(&trans->timer);
destroy_transaction(trans); if (trans->callref)
if (trans->callref) {
call_in_release(trans->callref, CAUSE_NORMAL); call_in_release(trans->callref, CAUSE_NORMAL);
trans->callref = 0; destroy_transaction(trans);
}
amps_go_idle(amps); amps_go_idle(amps);
break; break;
case TRANS_CALL_MT_ALERT: case TRANS_CALL_MT_ALERT: