summaryrefslogtreecommitdiff
path: root/main/loader.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-07-25 18:09:40 +0000
committerJoshua Colp <jcolp@digium.com>2014-07-25 18:09:40 +0000
commit702c503b7628520ec48b70f9bd851d84915bd4bd (patch)
tree6942f0b51fbefabfa5e34cb20d4edd5d51ed4ad8 /main/loader.c
parentdcf1ad14da48db3476dcaeeb3d3fb6b7d00a28ca (diff)
loader: Fix an infinite loop when printing modules using "module show".
When creating the alphabetical sorted list each module is added to a list temporarily. On the second iteration each module already has a pointer to another module, causing stuff to go into a loop. ASTERISK-24123 #close Reported by: Malcolm Davenport git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/loader.c')
-rw-r--r--main/loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/loader.c b/main/loader.c
index 343863a03..b4eef13c2 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -1368,7 +1368,7 @@ int ast_update_module_list(int (*modentry)(const char *module, const char *descr
AST_LIST_INSERT_SORTALPHA(&alpha_module_list, cur, list_entry, resource);
}
- AST_LIST_TRAVERSE(&alpha_module_list, cur, list_entry) {
+ while ((cur = AST_LIST_REMOVE_HEAD(&alpha_module_list, list_entry))) {
total_mod_loaded += modentry(cur->resource, cur->info->description, cur->usecount,
cur->flags.running ? "Running" : "Not Running", like, cur->info->support_level);
}