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
This commit is contained in:
Richard Mudgett
2016-08-22 15:01:37 -05:00
parent d2e03c252d
commit 5744f434f0
3 changed files with 14 additions and 7 deletions

View File

@@ -3088,7 +3088,9 @@ static int attach_framehook(struct attended_transfer_properties *props, struct a
ao2_ref(props, +1);
target_interface.data = props;
ast_channel_lock(channel);
props->target_framehook_id = ast_framehook_attach(channel, &target_interface);
ast_channel_unlock(channel);
if (props->target_framehook_id == -1) {
ao2_ref(props, -1);
return -1;