From a2828fa4bcd3f4245da33c7929bcef0f161317d4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 14 Nov 2010 15:50:42 +0100 Subject: [PATCH] bsc_api: Set the lchan->conn to NULL in all of the cases --- openbsc/src/bsc_api.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index 7a30e1649..9ab49f4e0 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -142,9 +142,6 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan) /* TODO: move subscriber put here... */ void subscr_con_free(struct gsm_subscriber_connection *conn) { - struct gsm_lchan *lchan; - - if (!conn) return; @@ -155,16 +152,18 @@ void subscr_con_free(struct gsm_subscriber_connection *conn) } - if (conn->ho_lchan) + if (conn->ho_lchan) { LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n"); + conn->ho_lchan->conn = NULL; + } + + if (conn->lchan) { + LOGP(DNM, LOGL_ERROR, "The lchan should have been cleared.\n"); + conn->lchan->conn = NULL; + } llist_del(&conn->entry); - - lchan = conn->lchan; talloc_free(conn); - - if (lchan) - lchan->conn = NULL; } int bsc_api_init(struct gsm_network *network, struct bsc_api *api)