res_pjsip_session.c: Fix crash when declining an active stream.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 18 Aug 2017 22:37:12 +0000 (17:37 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 22 Aug 2017 16:59:49 +0000 (11:59 -0500)
commitf2c14f00b8ae4cd1fa809db705d4c368f1cfed1a
tree1e81c11ce09e7626acbfc6a997f6a4d4aed38feb
parent17976d1b4e302b3aa7cc510109a78010d7893fe1
res_pjsip_session.c: Fix crash when declining an active stream.

If a previously active stream is declined we could crash because the
channel's thread is still using the stream while we are updating the
topology in the serializer thread.

* Defer removing any declined stream's handler until we have blocked the
channel's thread with the channel lock.

ASTERISK-27212

Change-Id: I50e1d3ef26f8e41948f4c411ee329aa3b960a420
res/res_pjsip_session.c