]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Yet another memory corruption issue.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 15 Nov 2007 18:05:56 +0000 (18:05 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 15 Nov 2007 18:05:56 +0000 (18:05 +0000)
Reported by: atis
Patch by: tilghman
Fixes issue #10923

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89298 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 7b68001dc6e133b59a7926ed3d856d232d8b2bcb..004e1de62d52d1e865a4ddf0619c1d82b11848c3 100644 (file)
@@ -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)
        */