mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix two cases of memory corruption caused by background threads.
Reported by: atis Patch by: tilghman Fixes issue #10923 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2067,6 +2067,14 @@ static int __sip_autodestruct(const void *data)
|
||||
return 10000; /* Reschedule this destruction so that we know that it's gone */
|
||||
}
|
||||
|
||||
/* If there are packets still waiting for delivery, delay the destruction */
|
||||
if (p->packets) {
|
||||
if (option_debug > 2)
|
||||
ast_log(LOG_DEBUG, "Re-scheduled destruction of SIP call %s\n", p->callid ? p->callid : "<unknown>");
|
||||
append_history(p, "ReliableXmit", "timeout");
|
||||
return 10000;
|
||||
}
|
||||
|
||||
/* If we're destroying a subscription, dereference peer object too */
|
||||
if (p->subscribed == MWI_NOTIFICATION && p->relatedpeer)
|
||||
ASTOBJ_UNREF(p->relatedpeer,sip_destroy_peer);
|
||||
|
@@ -1709,6 +1709,8 @@ int ast_hangup(struct ast_channel *chan)
|
||||
|
||||
detach_spies(chan); /* get rid of spies */
|
||||
|
||||
ast_autoservice_stop(chan);
|
||||
|
||||
if (chan->masq) {
|
||||
if (ast_do_masquerade(chan))
|
||||
ast_log(LOG_WARNING, "Failed to perform masquerade\n");
|
||||
|
Reference in New Issue
Block a user