mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user