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
changes/97/197/1
Joshua Colp 11 years ago
parent dcf1ad14da
commit 702c503b76

@ -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_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, total_mod_loaded += modentry(cur->resource, cur->info->description, cur->usecount,
cur->flags.running ? "Running" : "Not Running", like, cur->info->support_level); cur->flags.running ? "Running" : "Not Running", like, cur->info->support_level);
} }

Loading…
Cancel
Save