<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/25733">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm_lchan_name_update(): use shadow timeslot as talloc context<br><br>This way if a shadow timeslot gets free()d, the associated name<br>also gets freed.  This does not apply to the primary timeslots,<br>because they're not talloc chunks but part of 'struct gsm_bts_trx'.<br><br>Change-Id: Ie449f931db5431e8aa4ab9b232b19d22cbd330aa<br>Related: OS#5248<br>---<br>M src/common/lchan.c<br>1 file changed, 7 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/25733/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/common/lchan.c b/src/common/lchan.c</span><br><span>index f7ee33b..8115df7 100644</span><br><span>--- a/src/common/lchan.c</span><br><span>+++ b/src/common/lchan.c</span><br><span>@@ -67,9 +67,15 @@</span><br><span> {</span><br><span>   const struct gsm_bts_trx_ts *ts = lchan->ts;</span><br><span>      const struct gsm_bts_trx *trx = ts->trx;</span><br><span style="color: hsl(120, 100%, 40%);">+   void *talloc_ctx;</span><br><span>    char *name;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- name = talloc_asprintf(trx, "(" GSM_TS_NAME_FMT ",ss=%u)",</span><br><span style="color: hsl(120, 100%, 40%);">+        if (ts->vamos.is_shadow)</span><br><span style="color: hsl(120, 100%, 40%);">+           talloc_ctx = (void *)ts;</span><br><span style="color: hsl(120, 100%, 40%);">+      else</span><br><span style="color: hsl(120, 100%, 40%);">+          talloc_ctx = (void *)trx;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   name = talloc_asprintf(talloc_ctx, "(" GSM_TS_NAME_FMT ",ss=%u)",</span><br><span>                               GSM_TS_NAME_ARGS(ts), lchan->nr);</span><br><span>  if (lchan->name != NULL)</span><br><span>          talloc_free(lchan->name);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/25733">change 25733</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/c/osmo-bts/+/25733"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie449f931db5431e8aa4ab9b232b19d22cbd330aa </div>
<div style="display:none"> Gerrit-Change-Number: 25733 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>