mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Fix a crash caused by two threads thinking they should both free the
chan_local private structure when only one should. (closes issue #15314) Reported by: sroberts Patches: Issue15314_Move_Nulling_owner.patch uploaded by davidw (license 780) Tested by: davidw, lottc git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@230038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -574,11 +574,11 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
|
ast_clear_flag(p, LOCAL_LAUNCHED_PBX);
|
||||||
ast_module_user_remove(p->u_chan);
|
ast_module_user_remove(p->u_chan);
|
||||||
} else {
|
} else {
|
||||||
p->owner = NULL;
|
|
||||||
ast_module_user_remove(p->u_owner);
|
ast_module_user_remove(p->u_owner);
|
||||||
while (p->chan && ast_channel_trylock(p->chan)) {
|
while (p->chan && ast_channel_trylock(p->chan)) {
|
||||||
DEADLOCK_AVOIDANCE(&p->lock);
|
DEADLOCK_AVOIDANCE(&p->lock);
|
||||||
}
|
}
|
||||||
|
p->owner = NULL;
|
||||||
if (p->chan) {
|
if (p->chan) {
|
||||||
ast_queue_hangup(p->chan);
|
ast_queue_hangup(p->chan);
|
||||||
ast_channel_unlock(p->chan);
|
ast_channel_unlock(p->chan);
|
||||||
|
Reference in New Issue
Block a user