Use close_module_list() to free the list.
There are a pair of Coverity CIDs for these two.