mirror of
https://github.com/asterisk/asterisk.git
synced 2025-12-01 02:31:55 +00:00
core_unreal.c: Use ast instead of p->chan to get the DIALSTATUS variable
After p->chan = NULL, ast still points to the valid channel object, using ast safely accesses the channel's DIALSTATUS variable before it's fully destroyed Resolves: #1590
This commit is contained in:
@@ -1042,7 +1042,7 @@ int ast_unreal_hangup(struct ast_unreal_pvt *p, struct ast_channel *ast)
|
|||||||
ast_clear_flag(p, AST_UNREAL_CARETAKER_THREAD);
|
ast_clear_flag(p, AST_UNREAL_CARETAKER_THREAD);
|
||||||
p->chan = NULL;
|
p->chan = NULL;
|
||||||
if (p->owner) {
|
if (p->owner) {
|
||||||
const char *status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
|
const char *status = pbx_builtin_getvar_helper(chan, "DIALSTATUS");
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
ast_channel_hangupcause_set(p->owner, cause);
|
ast_channel_hangupcause_set(p->owner, cause);
|
||||||
|
|||||||
Reference in New Issue
Block a user