<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6150">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Correct some leaks in unit tests.<br><br>* chan_sip: channel in test_sip_rtpqos_1.<br>* test_config: config hook, config info and global config holder.<br>* test_core_format: format in format_attribute_set_without_interface.<br>* test_stream: unneeded frame duplication.<br>* test_taskprocessor: task_data.<br><br>Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31<br>---<br>M channels/sip/dialplan_functions.c<br>M tests/test_config.c<br>M tests/test_core_format.c<br>M tests/test_taskprocessor.c<br>4 files changed, 11 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/50/6150/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c<br>index 53d15dd..e74e57e 100644<br>--- a/channels/sip/dialplan_functions.c<br>+++ b/channels/sip/dialplan_functions.c<br>@@ -486,6 +486,9 @@<br>               dialog_unlink_all(p);<br>                 dialog_unref(p, "Destroy test object");<br>     }<br>+    if (chan) {<br>+          ast_channel_unref(chan);<br>+     }<br>     ast_rtp_engine_unregister(&test_engine);<br>  return res;<br> }<br>diff --git a/tests/test_config.c b/tests/test_config.c<br>index b4b38b8..2565ddb 100644<br>--- a/tests/test_config.c<br>+++ b/tests/test_config.c<br>@@ -1040,6 +1040,7 @@<br>   res = AST_TEST_PASS;<br> <br> out:<br>+       ast_config_hook_unregister("test_hook");<br>    delete_config_file();<br>         return res;<br> }<br>@@ -1677,6 +1678,8 @@<br>        configs.codeccapopt = NULL;<br>   ast_string_field_free_memory(&defaults);<br>  ast_string_field_free_memory(&configs);<br>+  aco_info_destroy(&cfg_info);<br>+     ao2_global_obj_release(global_obj);<br>   return res;<br> }<br> <br>diff --git a/tests/test_core_format.c b/tests/test_core_format.c<br>index 2140029..b9ea1b1 100644<br>--- a/tests/test_core_format.c<br>+++ b/tests/test_core_format.c<br>@@ -860,6 +860,7 @@<br> {<br>  RAII_VAR(struct ast_codec *, codec, NULL, ao2_cleanup);<br>       RAII_VAR(struct ast_format *, format, NULL, ao2_cleanup);<br>+    struct ast_format *attr_set;<br> <br>       switch (cmd) {<br>        case TEST_INIT:<br>@@ -885,10 +886,12 @@<br>                return AST_TEST_FAIL;<br>         }<br> <br>- if (!ast_format_attribute_set(format, "bees", "cool")) {<br>+ attr_set = ast_format_attribute_set(format, "bees", "cool");<br>+     if (!attr_set) {<br>              ast_test_status_update(test, "Successfully set an attribute on a format without an interface\n");<br>           return AST_TEST_FAIL;<br>         }<br>+    ao2_cleanup(attr_set);<br> <br>     return AST_TEST_PASS;<br> }<br>diff --git a/tests/test_taskprocessor.c b/tests/test_taskprocessor.c<br>index be48f92..ad2074c 100644<br>--- a/tests/test_taskprocessor.c<br>+++ b/tests/test_taskprocessor.c<br>@@ -677,7 +677,7 @@<br> {<br>   RAII_VAR(struct ast_taskprocessor *, tps, NULL,<br>               ast_taskprocessor_unreference);<br>-      struct task_data *task_data;<br>+ RAII_VAR(struct task_data *, task_data, NULL, ao2_cleanup);<br>   int local_data;<br>       int res;<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6150">change 6150</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6150"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I94d364d195cf3b3b5de2bf3ad565343275c7ad31 </div>
<div style="display:none"> Gerrit-Change-Number: 6150 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>