<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7031">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">format_cap: Fix leak on AST_VECTOR_APPEND error.<br><br>format_cap_framed_init can fail on AST_VECTOR_APPEND.  This should<br>report failure to the caller and clean the newly allocated frame.<br><br>Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0<br>---<br>M main/format_cap.c<br>1 file changed, 6 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/format_cap.c b/main/format_cap.c<br>index b0897c0..d71ccdb 100644<br>--- a/main/format_cap.c<br>+++ b/main/format_cap.c<br>@@ -160,12 +160,15 @@<br>        }<br>     list = AST_VECTOR_GET_ADDR(&cap->formats, ast_format_get_codec_id(format));<br> <br>+        /* This takes the allocation reference */<br>+    if (AST_VECTOR_APPEND(&cap->preference_order, framed)) {<br>+              ao2_ref(framed, -1);<br>+         return -1;<br>+   }<br>+<br>  /* Order doesn't matter for formats, so insert at the head for performance reasons */<br>     ao2_ref(framed, +1);<br>  AST_LIST_INSERT_HEAD(list, framed, entry);<br>-<br>-        /* This takes the allocation reference */<br>-    AST_VECTOR_APPEND(&cap->preference_order, framed);<br> <br>  cap->framing = MIN(cap->framing, framing ? framing : ast_format_get_default_ms(format));<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7031">change 7031</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/7031"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0 </div>
<div style="display:none"> Gerrit-Change-Number: 7031 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>