mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-28 23:15:59 +00:00
Fix memory leak while loading priority modules and adding formats
This patch fixes two memory leaks: * When we load a module with the LOAD_PRIORITY flag, we remove its entry from the load order list. Unfortunately, we don't free the memory associated with entry in the list. This patch corrects that and properly frees the memory for the module in the list. * When adding a custom format (such as SILK or CELT), the routine for adding the format was leaking a reference. RAII_VAR cleans this up properly. ........ Merged revisions 391489 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@391507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1035,6 +1035,8 @@ static int load_resource_list(struct load_order *load_order, unsigned int global
|
||||
break;
|
||||
case AST_MODULE_LOAD_PRIORITY:
|
||||
AST_LIST_REMOVE_CURRENT(entry);
|
||||
ast_free(order->resource);
|
||||
ast_free(order);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user