on the channel (such as if you set a call limit based on the system's load
average), then there were cases where a channel that has already been free'd
using ast_hangup() got accessed. This caused weird memory corruption and
crashes to occur.
(fixes issue BE-386)
(much debugging credit goes to twilson, final patch written by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107158
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
if (channel)
*channel = NULL;
ast_hangup(chan);
+ chan = NULL;
res = -1;
}
} else {
ast_channel_unlock(chan);
}
ast_hangup(chan);
+ chan = NULL;
res = -1;
}
}
ast_channel_unlock(chan);
}
ast_hangup(chan);
+ chan = NULL;
}
}
pbx_builtin_setvar_helper(chan, "REASON", failed_reason);
if (account)
ast_cdr_setaccount(chan, account);
- ast_pbx_run(chan);
+ if (ast_pbx_run(chan)) {
+ ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
+ ast_hangup(chan);
+ }
+ chan = NULL;
}
}
}