summaryrefslogtreecommitdiff
path: root/main/autoservice.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 09:26:40 -0500
commitede77acaaf31ad5e7e414e4aea0be52a589d00ca (patch)
treec5958435eb00bd9f7c125281cb5651744c935b51 /main/autoservice.c
parentbf19c0e5965927251e81a6df734c7124ba292004 (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/autoservice.c')
-rw-r--r--main/autoservice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/autoservice.c b/main/autoservice.c
index 1af052d08..3f8b4570a 100644
--- a/main/autoservice.c
+++ b/main/autoservice.c
@@ -297,11 +297,11 @@ int ast_autoservice_stop(struct ast_channel *chan)
res = 0;
}
+ ast_channel_lock(chan);
if (!as->orig_end_dtmf_flag) {
ast_clear_flag(ast_channel_flags(chan), AST_FLAG_END_DTMF_ONLY);
}
- ast_channel_lock(chan);
while ((f = AST_LIST_REMOVE_HEAD(&as->deferred_frames, frame_list))) {
if (!((1 << f->frametype) & as->ignore_frame_types)) {
ast_queue_frame_head(chan, f);