<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18928">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: Fix memory leak on updated menu options.<br><br>If the CONFBRIDGE function is used to dynamically set<br>menu options, a memory leak occurs when a menu option<br>that has been set is overridden, since the menu entry<br>is not destroyed before being freed. This ensures that<br>it is.<br><br>Additionally, logic that duplicates the destroy function<br>is removed in lieu of the destroy function itself.<br><br>ASTERISK-28422 #close<br><br>Change-Id: I71cfb5c24e636984d41086d1333a416dc12ff995<br>---<br>M apps/confbridge/conf_config_parser.c<br>1 file changed, 2 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/confbridge/conf_config_parser.c b/apps/confbridge/conf_config_parser.c</span><br><span>index b27adf2..d04bcf9 100644</span><br><span>--- a/apps/confbridge/conf_config_parser.c</span><br><span>+++ b/apps/confbridge/conf_config_parser.c</span><br><span>@@ -1440,10 +1440,7 @@</span><br><span> </span><br><span> /* if adding any of the actions failed, bail */</span><br><span> if (res) {</span><br><span style="color: hsl(0, 100%, 40%);">- struct conf_menu_action *menu_action;</span><br><span style="color: hsl(0, 100%, 40%);">- while ((menu_action = AST_LIST_REMOVE_HEAD(&menu_entry->actions, action))) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_free(menu_action);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(120, 100%, 40%);">+ conf_menu_entry_destroy(menu_entry);</span><br><span> ast_free(menu_entry);</span><br><span> return -1;</span><br><span> }</span><br><span>@@ -1452,6 +1449,7 @@</span><br><span> AST_LIST_TRAVERSE_SAFE_BEGIN(&menu->entries, cur, entry) {</span><br><span> if (!strcasecmp(cur->dtmf, menu_entry->dtmf)) {</span><br><span> AST_LIST_REMOVE_CURRENT(entry);</span><br><span style="color: hsl(120, 100%, 40%);">+ conf_menu_entry_destroy(cur);</span><br><span> ast_free(cur);</span><br><span> break;</span><br><span> }</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18928">change 18928</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/+/18928"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I71cfb5c24e636984d41086d1333a416dc12ff995 </div>
<div style="display:none"> Gerrit-Change-Number: 18928 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>