<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6148">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_stream.c<br>M tests/test_taskprocessor.c<br>5 files changed, 12 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/6148/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 e21bb2c..59e841d 100644<br>--- a/channels/sip/dialplan_functions.c<br>+++ b/channels/sip/dialplan_functions.c<br>@@ -484,6 +484,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 d737108..8675cb8 100644<br>--- a/tests/test_config.c<br>+++ b/tests/test_config.c<br>@@ -1038,6 +1038,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>@@ -1675,6 +1676,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 a697f8e..164dff8 100644<br>--- a/tests/test_core_format.c<br>+++ b/tests/test_core_format.c<br>@@ -858,6 +858,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>@@ -883,10 +884,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_stream.c b/tests/test_stream.c<br>index fdb9885..28983e0 100644<br>--- a/tests/test_stream.c<br>+++ b/tests/test_stream.c<br>@@ -1522,7 +1522,7 @@<br>                 }<br>             f.stream_num = pvt->frame_count % pvt->streams;<br>                 f.seqno = pvt->frame_count;<br>-               ast_queue_frame(chan, ast_frdup(&f));<br>+            ast_queue_frame(chan, &f);<br>                pvt->frame_count++;<br>        }<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/6148">change 6148</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/6148"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </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: 6148 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>