summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-05-13 16:40:00 +0000
committerJoshua Colp <jcolp@digium.com>2017-05-16 14:25:23 +0000
commit5a7af00e80b9f360a11fcbbc6c6b6dfd2ee478a6 (patch)
tree6f5b088ad13c1451d1e8421e57b9cd1a9a2d3434 /main/manager.c
parentce4d8dac91631599452a9c7aa9c81001704afb62 (diff)
asterisk: Audit locking of channel when manipulating flags.
When manipulating flags on a channel the channel has to be locked to guarantee that nothing else is also manipulating the flags. This change introduces locking where necessary to guarantee this. It also adds helper functions that manipulate channel flags and lock to reduce repeated code. ASTERISK-26789 Change-Id: I489280662dba0f4c50981bfc5b5a7073fef2db10
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/main/manager.c b/main/manager.c
index c592fbd37..dfb0d96c9 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -4847,14 +4847,10 @@ static int action_redirect(struct mansession *s, const struct message *m)
/* Release the bridge wait. */
if (chan1_wait) {
- ast_channel_lock(chan);
- ast_clear_flag(ast_channel_flags(chan), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT);
- ast_channel_unlock(chan);
+ ast_channel_clear_flag(chan, AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT);
}
if (chan2_wait) {
- ast_channel_lock(chan2);
- ast_clear_flag(ast_channel_flags(chan2), AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT);
- ast_channel_unlock(chan2);
+ ast_channel_clear_flag(chan, AST_FLAG_BRIDGE_DUAL_REDIRECT_WAIT);
}
chan2 = ast_channel_unref(chan2);