<p>Patch set 1:<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/10994">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10994/1/res/res_pjsip_t38.c">File res/res_pjsip_t38.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/10994/1/res/res_pjsip_t38.c@156">Patch Set #1, Line 156:</a> <code style="font-family:monospace,monospace"> return NULL;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think this still leaks the datastore if ast_sip_session_add_datastore fails.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10994/1/res/res_pjsip_t38.c@159">Patch Set #1, Line 159:</a> <code style="font-family:monospace,monospace"> ao2_ref(datastore, -1);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I don't think this is the complete fix. The problem is that you are returning datastore to the caller, but never actually using it there - it's just used to see if this was a success or failure.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the return value of the function should be changed to an int to return 0 on success, and -1 on failure.</p><p style="white-space: pre-wrap; word-wrap: break-word;">The ao2_ref(datastore, -1); should also be moved to after the datastore->data is set.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10994">change 10994</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/10994"/><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: Id6dceceb06651b03f611bf33deb3061022fe5d0c </div>
<div style="display:none"> Gerrit-Change-Number: 10994 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Paulo Vicentini <paulo.vicentini@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 13 Feb 2019 13:46:36 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>