summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/gsm_subscriber_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libcommon/gsm_subscriber_base.c')
-rw-r--r--openbsc/src/libcommon/gsm_subscriber_base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/openbsc/src/libcommon/gsm_subscriber_base.c
index 3d01ca20d..3c56101f6 100644
--- a/openbsc/src/libcommon/gsm_subscriber_base.c
+++ b/openbsc/src/libcommon/gsm_subscriber_base.c
@@ -91,7 +91,9 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr)
subscr->use_count--;
DEBUGP(DREF, "subscr %s usage decreased usage to: %d\n",
subscr->extension, subscr->use_count);
- if (subscr->use_count <= 0 && !subscr->group->keep_subscr)
+ if (subscr->use_count <= 0 &&
+ !((subscr->group && subscr->group->keep_subscr) ||
+ subscr->keep_in_ram))
subscr_free(subscr);
return NULL;
}