aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 18:05:56 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-15 18:05:56 +0000
commit6cb692da543a279fefbf1f5584835cfa89ae9b15 (patch)
tree7b7ca91ce932a3df1b6396781d5dd196429ba2c5 /channels
parenteb5f9ff2a19b8e283b71adc36f0a33040b759eb0 (diff)
Yet another memory corruption issue.
Reported by: atis Patch by: tilghman Fixes issue #10923 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89298 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 7b68001dc..004e1de62 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -8315,6 +8315,18 @@ static void *iax2_process_thread(void *data)
handle_deferred_full_frames(thread);
}
+ /*!\note For some reason, idle threads are exiting without being removed
+ * from an idle list, which is causing memory corruption. Forcibly remove
+ * it from the list, if it's there.
+ */
+ AST_LIST_LOCK(&idle_list);
+ AST_LIST_REMOVE(&idle_list, thread, list);
+ AST_LIST_UNLOCK(&idle_list);
+
+ AST_LIST_LOCK(&dynamic_list);
+ AST_LIST_REMOVE(&dynamic_list, thread, list);
+ AST_LIST_UNLOCK(&dynamic_list);
+
/* I am exiting here on my own volition, I need to clean up my own data structures
* Assume that I am no longer in any of the lists (idle, active, or dynamic)
*/