Change the subscriber and database backend
gsm_subscriber is now refcounted, the db backend is leaking
a lot less, db_get_subscriber will allocate the subscr record
now, subscr_* will look up a subscriber in the list of currently
active subscribers and add an ref to this one.
The db test cases pass, more testing will be when next to the bts
diff --git a/src/chan_alloc.c b/src/chan_alloc.c
index 98588b1..439a8da 100644
--- a/src/chan_alloc.c
+++ b/src/chan_alloc.c
@@ -188,7 +188,10 @@
void lchan_free(struct gsm_lchan *lchan)
{
lchan->type = GSM_LCHAN_NONE;
- lchan->subscr = 0;
+ if (lchan->subscr) {
+ subscr_put(lchan->subscr);
+ lchan->subscr = 0;
+ }
/* stop the timer */
del_timer(&lchan->release_timer);