<p> Attention is currently required from: N A. </p>
<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17652">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File apps/app_sf.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/17652/comment/76275d69_434d1bf7">Patch Set #2, Line 223:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                                                              if (!(dsp = ast_dsp_new())) {<br>                                                                 ast_log(LOG_WARNING, "Unable to allocate DSP!\n");<br>                                                                  pbx_builtin_setvar_helper(chan, "RECEIVESFSTATUS", "ERROR");<br>                                                                      ast_frfree(frame);<br>                                                                    return -1;<br>                                                            }<br>                                                             ast_dsp_set_features(dsp, DSP_FEATURE_FREQ_DETECT);<br>                                                           ast_dsp_set_freqmode(dsp, freq, SF_MIN_DETECT, 16, 0);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Did you mean to dupe the dsp new, set features, and frequmode code from above here? 'dsp' is set above. If you need to reset it then you need to free it first or what you have here will cause a memory leak.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/17652/comment/0cecfb1b_6e926539">Patch Set #2, Line 278:</a> <code style="font-family:monospace,monospace">                             }</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">'frame' is leaked here on each loop.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File main/app.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/17652/comment/b7694072_b7e60112">Patch Set #2, Line 870:</a> <code style="font-family:monospace,monospace"> freq = ast_malloc(32);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Why 32? Either make this a description #define or add a comment about the size.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Also, since this is a small, set allocation you could either declare 'freq' as stack allocated fixed array, or use ast_alloca here.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If you do change this to a stack allocated variable then you can also remove the associated ast_free below.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17652">change 17652</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/+/17652"/><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-Change-Id: I7ec50752e9a661af639425e5d1e339f17411bcad </div>
<div style="display:none"> Gerrit-Change-Number: 17652 </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: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 16 Dec 2021 00:21:10 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>