diff options
author | Corey Farrell <git@cfware.com> | 2017-08-03 22:30:12 -0400 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-08-03 21:31:38 -0500 |
commit | 84b6a5efd7503817912958f3203bca15b37d3398 (patch) | |
tree | feca22b6e368a363bb99783a429105ce386c7315 /tests | |
parent | ed1bce956e30d9f8ec8defcbae33ea3217dd8fb6 (diff) |
Correct some leaks in unit tests.
* chan_sip: channel in test_sip_rtpqos_1.
* test_config: config hook, config info and global config holder.
* test_core_format: format in format_attribute_set_without_interface.
* test_stream: unneeded frame duplication.
* test_taskprocessor: task_data.
Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_config.c | 3 | ||||
-rw-r--r-- | tests/test_core_format.c | 5 | ||||
-rw-r--r-- | tests/test_taskprocessor.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_config.c b/tests/test_config.c index 602c3e7d3..8fb473535 100644 --- a/tests/test_config.c +++ b/tests/test_config.c @@ -1040,6 +1040,7 @@ AST_TEST_DEFINE(config_hook) res = AST_TEST_PASS; out: + ast_config_hook_unregister("test_hook"); delete_config_file(); return res; } @@ -1677,6 +1678,8 @@ AST_TEST_DEFINE(config_options_test) configs.codeccapopt = NULL; ast_string_field_free_memory(&defaults); ast_string_field_free_memory(&configs); + aco_info_destroy(&cfg_info); + ao2_global_obj_release(global_obj); return res; } diff --git a/tests/test_core_format.c b/tests/test_core_format.c index a3819c6d0..e4199dbed 100644 --- a/tests/test_core_format.c +++ b/tests/test_core_format.c @@ -860,6 +860,7 @@ AST_TEST_DEFINE(format_attribute_set_without_interface) { RAII_VAR(struct ast_codec *, codec, NULL, ao2_cleanup); RAII_VAR(struct ast_format *, format, NULL, ao2_cleanup); + struct ast_format *attr_set; switch (cmd) { case TEST_INIT: @@ -885,10 +886,12 @@ AST_TEST_DEFINE(format_attribute_set_without_interface) return AST_TEST_FAIL; } - if (!ast_format_attribute_set(format, "bees", "cool")) { + attr_set = ast_format_attribute_set(format, "bees", "cool"); + if (!attr_set) { ast_test_status_update(test, "Successfully set an attribute on a format without an interface\n"); return AST_TEST_FAIL; } + ao2_cleanup(attr_set); return AST_TEST_PASS; } diff --git a/tests/test_taskprocessor.c b/tests/test_taskprocessor.c index be48f9248..ad2074cb8 100644 --- a/tests/test_taskprocessor.c +++ b/tests/test_taskprocessor.c @@ -677,7 +677,7 @@ AST_TEST_DEFINE(taskprocessor_push_local) { RAII_VAR(struct ast_taskprocessor *, tps, NULL, ast_taskprocessor_unreference); - struct task_data *task_data; + RAII_VAR(struct task_data *, task_data, NULL, ao2_cleanup); int local_data; int res; |