mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
Fix case where local is allocated but not actually called on
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -230,12 +230,14 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
int isoutbound = IS_OUTBOUND(ast, p);
|
int isoutbound = IS_OUTBOUND(ast, p);
|
||||||
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
||||||
struct local_pvt *cur, *prev=NULL;
|
struct local_pvt *cur, *prev=NULL;
|
||||||
|
struct ast_channel *ochan = NULL;
|
||||||
ast_pthread_mutex_lock(&p->lock);
|
ast_pthread_mutex_lock(&p->lock);
|
||||||
if (isoutbound)
|
if (isoutbound)
|
||||||
p->chan = NULL;
|
p->chan = NULL;
|
||||||
else
|
else
|
||||||
p->owner = NULL;
|
p->owner = NULL;
|
||||||
ast->pvt->pvt = NULL;
|
ast->pvt->pvt = NULL;
|
||||||
|
|
||||||
if (!p->owner && !p->chan) {
|
if (!p->owner && !p->chan) {
|
||||||
/* Okay, done with the private part now, too. */
|
/* Okay, done with the private part now, too. */
|
||||||
ast_pthread_mutex_unlock(&p->lock);
|
ast_pthread_mutex_unlock(&p->lock);
|
||||||
@@ -258,8 +260,14 @@ static int local_hangup(struct ast_channel *ast)
|
|||||||
free(p);
|
free(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
local_queue_frame(p, isoutbound, &f);
|
if (p->chan && !p->chan->pbx)
|
||||||
|
/* Need to actually hangup since there is no PBX */
|
||||||
|
ochan = p->chan;
|
||||||
|
else
|
||||||
|
local_queue_frame(p, isoutbound, &f);
|
||||||
ast_pthread_mutex_unlock(&p->lock);
|
ast_pthread_mutex_unlock(&p->lock);
|
||||||
|
if (ochan)
|
||||||
|
ast_hangup(ochan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user