aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 17:29:17 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 17:29:17 +0000
commit30ed5ed291cdcad37642eb71631a616cd2ab3e25 (patch)
tree639d9768258f002fd8ccd8f64ea1ec66c41e7a05 /channels
parent14834b987bf2bc2a1e6bbcf2bfd7550f3b083874 (diff)
Fix two cases of memory corruption caused by background threads.
Reported by: atis Patch by: tilghman Fixes issue #10923 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89184 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0b52a8677..8b9f96f74 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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);