]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix memory leak while loading priority modules
authorMatthew Jordan <mjordan@digium.com>
Wed, 12 Jun 2013 02:19:52 +0000 (02:19 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 12 Jun 2013 02:19:52 +0000 (02:19 +0000)
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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391489 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/loader.c

index 2b09157935cbf3ade54805e93e6f47de8a011500..16ab2d75eef064e94b23c76bd2565b8daaa640df 100644 (file)
@@ -1021,6 +1021,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;
                }
        }