summaryrefslogtreecommitdiff
path: root/main/format.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-06-12 02:29:08 +0000
committerMatthew Jordan <mjordan@digium.com>2013-06-12 02:29:08 +0000
commit272dd008d08b93c96cbab94fd2bcd607152681f7 (patch)
treef5c55bb1acdbb448bdeff64ab059b45a615d3881 /main/format.c
parent41e428275101c117607f9a6503f054f13fa8f78b (diff)
Fix memory leak while loading modules, adding formats, and destroying endpoints
This patch fixes three 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. * We now de-ref the channel_snapshot appropriately when an endpoint is disposed of ........ Merged revisions 391489 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391507 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/format.c')
-rw-r--r--main/format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/format.c b/main/format.c
index 36aa534c0..5b8b8b05f 100644
--- a/main/format.c
+++ b/main/format.c
@@ -912,7 +912,7 @@ static struct ast_cli_entry my_clis[] = {
static int format_list_add_custom(struct ast_format_list *new)
{
- struct ast_format_list *entry;
+ RAII_VAR(struct ast_format_list *, entry, NULL, ao2_cleanup);
if (!(entry = ao2_alloc(sizeof(*entry), NULL))) {
return -1;
}