aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/msc_vty.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-12-12 04:02:29 +0100
committerHarald Welte <laforge@gnumonks.org>2018-12-18 18:01:26 +0000
commit14c6f3ee95e53a0dea872eadf7ed6330b3d1c71b (patch)
tree145c8889b85b95472c69292ce3d769e94de3e72b /src/libmsc/msc_vty.c
parent4776b0526cb85e9ff67f4c54f04168a0591872ea (diff)
vty: show subscriber: put() before printing the use count
Do not show the VTY command's own use count during 'show subscriber <ID>'. When using 'show subscriber msisdn 2023', I was surprised to see a use count of 2 and suspected a use count leak. With 'show subscriber cache' however, the use count is 1. So I realized it is the vty command's own use count that makes it two, besides the lu_complete=true one. Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699
Diffstat (limited to 'src/libmsc/msc_vty.c')
-rw-r--r--src/libmsc/msc_vty.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 87adc82de..4e71e2628 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -832,10 +832,13 @@ DEFUN(show_subscr,
return CMD_WARNING;
}
- subscr_dump_full_vty(vty, vsub);
-
+ /* In the vty output to the user, exclude this local use count added by vlr_subscr_get() in get_vsub_by_argv().
+ * This works, because: for get_vsub_by_argv() to succeed, there *must* have been at least one use count before
+ * this, and since this is not multi-threaded, this vlr_subscr_put() cannot possibly reach a count of 0. */
vlr_subscr_put(vsub);
+ subscr_dump_full_vty(vty, vsub);
+
return CMD_SUCCESS;
}