<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/12266">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: show subscriber: put() before printing the use count<br><br>Do not show the VTY command's own use count during 'show subscriber <ID>'.<br><br>When using 'show subscriber msisdn 2023', I was surprised to see a use count of<br>2 and suspected a use count leak. With 'show subscriber cache' however, the use<br>count is 1.<br><br>So I realized it is the vty command's own use count that makes it two, besides<br>the lu_complete=true one.<br><br>Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699<br>---<br>M src/libmsc/msc_vty.c<br>1 file changed, 5 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c</span><br><span>index 87adc82..4e71e26 100644</span><br><span>--- a/src/libmsc/msc_vty.c</span><br><span>+++ b/src/libmsc/msc_vty.c</span><br><span>@@ -832,10 +832,13 @@</span><br><span>              return CMD_WARNING;</span><br><span>  }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   subscr_dump_full_vty(vty, vsub);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+      /* In the vty output to the user, exclude this local use count added by vlr_subscr_get() in get_vsub_by_argv().</span><br><span style="color: hsl(120, 100%, 40%);">+        * This works, because: for get_vsub_by_argv() to succeed, there *must* have been at least one use count before</span><br><span style="color: hsl(120, 100%, 40%);">+        * this, and since this is not multi-threaded, this vlr_subscr_put() cannot possibly reach a count of 0. */</span><br><span>  vlr_subscr_put(vsub);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     subscr_dump_full_vty(vty, vsub);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12266">change 12266</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/12266"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699 </div>
<div style="display:none"> Gerrit-Change-Number: 12266 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@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: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Max <msuraev@sysmocom.de> </div>