<p>Patch set 4:<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/11827">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11827/4/include/osmocom/gsm/gsm0808_utils.h">File include/osmocom/gsm/gsm0808_utils.h:</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/11827/4/include/osmocom/gsm/gsm0808_utils.h@71">Patch Set #4, Line 71:</a> <code style="font-family:monospace,monospace"> uint8_t *net;    /* Network ID, ITU-T Q.1902.3 */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same, here, why not using net[5]?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11827/4/include/osmocom/gsm/gsm0808_utils.h@74">Patch Set #4, Line 74:</a> <code style="font-family:monospace,monospace">       uint8_t *cr;     /* Call Reference ID (5 octets) */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">if it's 5 octets, why not using uint8_t cr[5] ?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11827/4/src/gsm/gsm0808.c">File src/gsm/gsm0808.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/11827/4/src/gsm/gsm0808.c@416">Patch Set #4, Line 416:</a> <code style="font-family:monospace,monospace"> if (!msg || !g)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">if g==NULL and alloc works --> memory leak.</p><p style="white-space: pre-wrap; word-wrap: break-word;">No need to check for !g, just remove it, I think we can assume we don't pass NULL to it since it makes no sense.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11827/4/tests/gsm0808/gsm0808_test.c">File tests/gsm0808/gsm0808_test.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/11827/4/tests/gsm0808/gsm0808_test.c@138">Patch Set #4, Line 138:</a> <code style="font-family:monospace,monospace">  uint8_t net[g.net_len], pnet[g.net_len], cr[5], pcr[5] = { 0 };</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">See? no need for all this, just define arrays in the struct instead of pointers.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11827">change 11827</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/11827"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf </div>
<div style="display:none"> Gerrit-Change-Number: 11827 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 19 Nov 2018 17:39:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>