aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libbsc')
-rw-r--r--src/libbsc/bsc_api.c5
-rw-r--r--src/libbsc/bsc_subscriber.c5
-rw-r--r--src/libbsc/paging.c1
3 files changed, 8 insertions, 3 deletions
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 7cbe129d1..337aa1d7d 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -349,6 +349,11 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn)
/* drop pending messages */
ho_dtap_cache_flush(conn, 0);
+ if (conn->bsub) {
+ bsc_subscr_put(conn->bsub);
+ conn->bsub = NULL;
+ }
+
llist_del(&conn->entry);
talloc_free(conn);
}
diff --git a/src/libbsc/bsc_subscriber.c b/src/libbsc/bsc_subscriber.c
index d9d90baa9..65a660b40 100644
--- a/src/libbsc/bsc_subscriber.c
+++ b/src/libbsc/bsc_subscriber.c
@@ -41,7 +41,6 @@ static struct bsc_subscr *bsc_subscr_alloc(struct llist_head *list)
return NULL;
llist_add_tail(&bsub->entry, list);
- bsub->use_count = 1;
return bsub;
}
@@ -92,7 +91,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsc_subscr_set_imsi(bsub, imsi);
- return bsub;
+ return bsc_subscr_get(bsub);
}
struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
@@ -104,7 +103,7 @@ struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
return bsub;
bsub = bsc_subscr_alloc(list);
bsub->tmsi = tmsi;
- return bsub;
+ return bsc_subscr_get(bsub);
}
const char *bsc_subscr_name(struct bsc_subscr *bsub)
diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index 314dfddd9..d738c1b41 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -424,6 +424,7 @@ void paging_request_stop(struct llist_head *bts_list,
struct gsm_bts *bts;
log_set_context(LOG_CTX_BSC_SUBSCR, bsub);
+ conn->bsub = bsc_subscr_get(bsub);
/* Stop this first and dispatch the request */
if (_bts) {