summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2007-12-31 23:44:45 +0000
committerMark Michelson <mmichelson@digium.com>2007-12-31 23:44:45 +0000
commit3b830da05393facb7474a3039e51b05273f1032b (patch)
tree5c2e41f399a57d2270bb61088887f84642478257 /main
parente0dfa91db8014d4f95e6d974cc914c42c65a5cb5 (diff)
Merged revisions 95577 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r95577 | mmichelson | 2007-12-31 17:43:13 -0600 (Mon, 31 Dec 2007) | 9 lines Avoiding a potentially bad locking situation. ast_merge_contexts_and_delete writelocks the conlock, then calls ast_hint_extension, which attempts to readlock the same lock. Recursion with read-write locks is dangerous, so the inner lock needs to be removed. I did this by copying the "guts" of ast_hint_extension into ast_merge_contexts_and_delete (sans the extra lock). (this change is inspired by the locking problems seen in issue #11080, but I have no idea if this is the problematic area experienced by the reporters of that issue) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 2671733d8..64e34a419 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5211,7 +5211,8 @@ void ast_merge_contexts_and_delete(struct ast_context **extcontexts, const char
cannot be restored
*/
while ((this = AST_LIST_REMOVE_HEAD(&store, list))) {
- exten = ast_hint_extension(NULL, this->context, this->exten);
+ struct pbx_find_info q = { .stacklen = 0 };
+ exten = pbx_find_extension(NULL, NULL, &q, this->context, this->exten, PRIORITY_HINT, NULL, "", E_MATCH);
/* Find the hint in the list of hints */
AST_RWLIST_TRAVERSE(&hints, hint, list) {
if (hint->exten == exten)