<p> Attention is currently required from: Alexei Gradinari. </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/+/17954">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File configs/samples/pjsip.conf.sample:</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/+/17954/comment/578122c8_f9ca8401">Patch Set #2, Line 1460:</a> <code style="font-family:monospace,monospace"> ; If disabled the resource name will be '1234'.</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">If disabled I think the name is 'user1234' vs '1234' correct?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_pubsub.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/+/17954/comment/b611e5bd_7cb7d1cd">Patch Set #2, Line 1253:</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;"> const char *resource, char *display_name, struct sip_subscription_tree *tree)<br>{<br> struct ast_sip_subscription *sub;<br> pjsip_sip_uri *contact_uri;<br><br> sub = ast_calloc(1, sizeof(*sub) + strlen(resource) + 1);<br> if (!sub) {<br> return NULL;<br> }<br> strcpy(sub->resource, resource); /* Safe */<br><br> sub->display_name = display_name;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since the subscription here is taking ownership of the display_name memory make display_name a const parameter and then dupe it here when setting vs. requiring the caller to dupe the string prior to calling.</p><p style="white-space: pre-wrap; word-wrap: break-word;">It's easier to trace allocation that way (done in one spot) and freeing (also done in one spot). Callers are also ensured the string they pass in is not being modified.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17954">change 17954</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/+/17954"/><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: Ic5306bd5a7c73d03f5477fe235e9b0f41c69c681 </div>
<div style="display:none"> Gerrit-Change-Number: 17954 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.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-Attention: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 11 Feb 2022 22:00:31 +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>