<p> Attention is currently required from: Stanislav Abramenkov, George Joseph. </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/+/18697">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_geolocation.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/+/18697/comment/31472bb4_f2eb49da">Patch Set #1, Line 300:</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;">        geoloc_hdr_value = ast_alloca(geoloc_hdr->hvalue.slen + 1);<br>        ast_copy_pj_str(geoloc_hdr_value, &geoloc_hdr->hvalue, geoloc_hdr->hvalue.slen + 1);<br>        duped_geoloc_hdr_value = ast_strdupa(geoloc_hdr_value);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">geoloc_hdr_value contains a local copy that appears unused, so I think you can just use that directly without having to dupe/copy it a second time.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18697/comment/4813b863_6cfe6b2d">Patch Set #1, Line 381:</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;">          rc = ast_geoloc_datastore_add_eprofile(ds, eprofile);<br>         if (rc <= 0) {<br>                     SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_WARNING,<br>                              "%s: Couldn't add eprofile '%s' to datastore\n", session_name,<br>                          eprofile->id);<br>             }<br>             eprofile = NULL;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think this causes a ref leak on eprofile.</p><p style="white-space: pre-wrap; word-wrap: break-word;">ast_geoloc_eprofile_create_from_profile adds a ref, ast_geoloc_datastore_add_eprofile bumps the eprofile ref, so eprofile = +2 ref. But then you set it to NULL here so RAII_VAR does not remove the extra ref when leaving this function</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18697/comment/b844a1dc_ab0adb93">Patch Set #1, Line 491:</a> <code style="font-family:monospace,monospace">  SCOPE_EXIT_RTN_VALUE(0, "%s: PIDF-LO added with cid '%s'\n", session_name, base_cid);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">base_cid is leaked here.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18697/comment/97d52ce6_d402988b">Patch Set #1, Line 612:</a> <code style="font-family:monospace,monospace">              struct ast_geoloc_eprofile *ep = ast_geoloc_datastore_get_eprofile(tempds, i);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">ep is ref leaked on each loop.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18697">change 18697</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/+/18697"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ie2e2bcd87243c2cfabc43eb823d4427c7086f4d9 </div>
<div style="display:none"> Gerrit-Change-Number: 18697 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Stanislav Abramenkov <stas.abramenkov@gmail.com> </div>
<div style="display:none"> Gerrit-Attention: Stanislav Abramenkov <stas.abramenkov@gmail.com> </div>
<div style="display:none"> Gerrit-Attention: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 07 Jul 2022 16:56:02 +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>