summaryrefslogtreecommitdiff
path: root/res/res_pjsip_refer.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-08-22 15:01:37 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-08-25 17:11:50 -0500
commit5744f434f0eaba9633e7574d9cd0f8193dfd67e1 (patch)
treeedf5d6ce291ea2840395e467c30bb4deab49970d /res/res_pjsip_refer.c
parentd2e03c252d128d43fdbfe5906e238e8e0f90c0ab (diff)
ast_framehook_attach() must be called with the channel locked.
The framehook container could become corrupted if the channel lock is not held before calling. Change-Id: I1a6b957a1f7b899eb29a186915f8cccab886a438
Diffstat (limited to 'res/res_pjsip_refer.c')
-rw-r--r--res/res_pjsip_refer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index 1043a1e24..78d6e23b5 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -607,7 +607,10 @@ static void refer_blind_callback(struct ast_channel *chan, struct transfer_chann
ao2_ref(refer->progress, +1);
/* If we can't attach a frame hook for whatever reason send a notification of success immediately */
- if ((refer->progress->framehook = ast_framehook_attach(chan, &hook)) < 0) {
+ ast_channel_lock(chan);
+ refer->progress->framehook = ast_framehook_attach(chan, &hook);
+ ast_channel_unlock(chan);
+ if (refer->progress->framehook < 0) {
struct refer_progress_notification *notification = refer_progress_notification_alloc(refer->progress, 200,
PJSIP_EVSUB_STATE_TERMINATED);