<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10476">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c">File res/res_pjsip/pjsip_configuration.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/10476/1/res/res_pjsip/pjsip_configuration.c@593">Patch Set #1, Line 593:</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;">       ast_free(endpoint->id.self.name.str);<br>      endpoint->id.self.name.valid = 0;<br>  ast_free(endpoint->id.self.number.str);<br>    endpoint->id.self.number.valid = 0;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">You need to explicitly set the freed pointer to NULL or you could have stale pointers and a future double free.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c@665">Patch Set #1, Line 665:</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 (!var->value) {<br>         return 0;<br>     }<br><br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Test not needed because var->value can never be NULL<br>See ast_variable_new()</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10476/1/res/res_pjsip/pjsip_configuration.c@2044">Patch Set #1, Line 2044:</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 (!endpoint->id.self.tag) {<br>              endpoint->id.self.tag=ast_strdup("");<br>    }<br></pre></blockquote></p><ul><li>Just need to ast_strdup() into the tag.  ast_party_id_init() will always return with tag NULL.</li></ul><ul><li>guidelines: spaces around assignment operator '='</li></ul></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10476">change 10476</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/10476"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I86ba455c4677ca8d516d9a04ce7fb4d24dd576e4 </div>
<div style="display:none"> Gerrit-Change-Number: 10476 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 12 Oct 2018 18:15:30 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>