<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16452">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">test_abstract_jb.c: Fix put and put_out_of_order memory leaks.<br><br>We can't rely on RAII_VAR(...) to properly clean up data that is<br>allocated within a loop.<br><br>ASTERISK-27176 #close<br><br>Change-Id: Ib575616101230c4f603519114ec62ebf3936882c<br>---<br>M tests/test_abstract_jb.c<br>1 file changed, 8 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/16452/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/test_abstract_jb.c b/tests/test_abstract_jb.c</span><br><span>index 53614bc..af0c04b 100644</span><br><span>--- a/tests/test_abstract_jb.c</span><br><span>+++ b/tests/test_abstract_jb.c</span><br><span>@@ -293,8 +293,8 @@</span><br><span> RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \</span><br><span> const struct ast_jb_impl *impl; \</span><br><span> struct ast_jb_conf conf; \</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct ast_frame *, actual_frame, NULL, ast_frame_dtor); \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_frame *expected_frame = NULL; \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_frame *actual_frame = NULL; \</span><br><span> int res; \</span><br><span> long next; \</span><br><span> int i; \</span><br><span>@@ -341,8 +341,8 @@</span><br><span> return AST_TEST_FAIL; \</span><br><span> } \</span><br><span> VERIFY_FRAME(actual_frame, expected_frame); \</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(expected_frame); \</span><br><span style="color: hsl(0, 100%, 40%);">- expected_frame = NULL; \</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frame_dtor(expected_frame); \</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frame_dtor(actual_frame); \</span><br><span> } \</span><br><span> return AST_TEST_PASS; \</span><br><span> }</span><br><span>@@ -427,8 +427,8 @@</span><br><span> RAII_VAR(struct ast_jb *, jb, &default_jb, dispose_jitterbuffer); \</span><br><span> const struct ast_jb_impl *impl; \</span><br><span> struct ast_jb_conf conf; \</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct ast_frame *, actual_frame, NULL, ast_frame_dtor); \</span><br><span style="color: hsl(0, 100%, 40%);">- RAII_VAR(struct ast_frame *, expected_frame, NULL, ast_frame_dtor); \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_frame *expected_frame = NULL; \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_frame *actual_frame = NULL; \</span><br><span> int res; \</span><br><span> long next; \</span><br><span> int i; \</span><br><span>@@ -483,7 +483,8 @@</span><br><span> return AST_TEST_FAIL; \</span><br><span> } \</span><br><span> VERIFY_FRAME(actual_frame, expected_frame); \</span><br><span style="color: hsl(0, 100%, 40%);">- ast_frfree(expected_frame); \</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frame_dtor(expected_frame); \</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_frame_dtor(actual_frame); \</span><br><span> expected_frame = NULL; \</span><br><span> } \</span><br><span> \</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16452">change 16452</a>. To unsubscribe, or for help writing mail filters, 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/c/asterisk/+/16452"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: Ib575616101230c4f603519114ec62ebf3936882c </div>
<div style="display:none"> Gerrit-Change-Number: 16452 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>