<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7065">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test_sorcery_memory_cache_thrash: Handle error from vector append.<br><br>Cleanup resources when we fail to append the vector and report test<br>failure.<br><br>Change-Id: I6eb41586fd11dee8c0dfe35e91cb465a4cab7298<br>---<br>M tests/test_sorcery_memory_cache_thrash.c<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/7065/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/test_sorcery_memory_cache_thrash.c b/tests/test_sorcery_memory_cache_thrash.c<br>index c0d25fe..dfe7a7c 100644<br>--- a/tests/test_sorcery_memory_cache_thrash.c<br>+++ b/tests/test_sorcery_memory_cache_thrash.c<br>@@ -218,7 +218,11 @@<br>          /* This purposely holds no ref as the main thrash structure does */<br>           thread->sorcery = thrash->sorcery;<br> <br>-          AST_VECTOR_APPEND(&thrash->threads, thread);<br>+          if (AST_VECTOR_APPEND(&thrash->threads, thread)) {<br>+                    ast_free(thread);<br>+                    ao2_ref(thrash, -1);<br>+                 return NULL;<br>+         }<br>     }<br> <br>  return thrash;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7065">change 7065</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/7065"/><meta itemprop="name" content="View Change"/></div></div>

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