<p>Patch set 5:<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.osmocom.org/13479">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c">File src/hlr_ussd.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.osmocom.org/#/c/13479/5/src/hlr_ussd.c@238">Patch Set #5, Line 238:</a> <code style="font-family:monospace,monospace">ss->subscr</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This will always remain NULL, because AFAICS you never set this pointer...</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@251">Patch Set #5, Line 251:</a> <code style="font-family:monospace,monospace">return -EINVAL;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">memleak: msg was allocated dynamically, so here you need to free it.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@260">Patch Set #5, Line 260:</a> <code style="font-family:monospace,monospace">return -EINVAL;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same here.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@263">Patch Set #5, Line 263:</a> <code style="font-family:monospace,monospace">USSD</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">'SS/USSD' would be more correct, as we would also deal with "structured" Supplementary Services some day.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@286">Patch Set #5, Line 286:</a> <code style="font-family:monospace,monospace">resp_msg = gsm0480_msgb_alloc_name(__func__);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So here we allocate a message buffer on heap...</p><p style="white-space: pre-wrap; word-wrap: break-word;">BTW (off-topic): why do we use gsm0480_msgb_alloc_name()? We have nothing to do with GSM 04.80 at the HLR - it's only used to encapsulate the SS payload between MS and MSC. This is not that critical, but may be misleading.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Also, gsm0480_msgb_alloc_name() allocates a smaller buffer:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  return msgb_alloc_headroom(1024, 128, name);</pre><p style="white-space: pre-wrap; word-wrap: break-word;">than osmo_gsup_client_msgb_alloc() does:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  return msgb_alloc_headroom(4000, 64, __func__);</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13479">change 13479</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/13479"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3 </div>
<div style="display:none"> Gerrit-Change-Number: 13479 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 05 Apr 2019 19:34:50 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>