diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-08-24 14:14:57 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-08-24 14:59:12 +0200 |
commit | 25b3ffb5f4cd2b2ef393b458096316272d7ee5b0 (patch) | |
tree | 3eb90c79012053c51ec3255da4a23bee113731b4 | |
parent | eb1b3ab6da3fc9c61546288c4d0967b5d13fc2cd (diff) |
vlr_sgs.c: Fix missing use_count decrease in vlr_sgs_imsi_detach
it was recently observed in a pcap trace with gsmtap_log that the
use_count contained a "vlr_sgs_imsi_detach" item despite no related
message was seen near by. Further investigation shows that there's an
unbalanced get+put code path, introduced by an early return added to fix
another issue.
related: SYS#5337
Fixes: 0803d88d9aa6ff36896fbde218018db3bea61dc7
Change-Id: I91ae956e50fca2f4d0e1d145d60ccb0ebfb409e9
-rw-r--r-- | src/libvlr/vlr_sgs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libvlr/vlr_sgs.c b/src/libvlr/vlr_sgs.c index 565988621..64215816c 100644 --- a/src/libvlr/vlr_sgs.c +++ b/src/libvlr/vlr_sgs.c @@ -148,8 +148,10 @@ void vlr_sgs_imsi_detach(struct vlr_instance *vlr, const char *imsi, enum sgsap_ /* See also: 3GPP TS 29.118, 5.6.3 Procedures in the VLR: In case of * an implicit detach, we are supposed to check if the state of the * SGs-association, and only when it is not SGs-NULL, we may proceed. */ - if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && type == SGSAP_ID_NONEPS_T_IMPLICIT_UE_EPS_NONEPS) + if (vsub->sgs_fsm->state == SGS_UE_ST_NULL && type == SGSAP_ID_NONEPS_T_IMPLICIT_UE_EPS_NONEPS) { + vlr_subscr_put(vsub, __func__); return; + } switch (type) { case SGSAP_ID_NONEPS_T_EXPLICIT_UE_NONEPS: |