From: Arran Cudbard-Bell Date: Thu, 5 Jul 2018 02:27:52 +0000 (-0400) Subject: Actuall free the link X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2da8dcc5706dbc4807dcdcb779463bd8dc76d182;p=thirdparty%2Ffreeradius-server.git Actuall free the link --- diff --git a/src/modules/rlm_sigtran/event.c b/src/modules/rlm_sigtran/event.c index c754ae2b9f8..ba744e7bd0c 100644 --- a/src/modules/rlm_sigtran/event.c +++ b/src/modules/rlm_sigtran/event.c @@ -132,6 +132,14 @@ static int _mtp3_link_free(struct mtp_link *mtp3_link) return 0; } +static int _conn_free(sigtran_conn_t *conn) +{ + talloc_free(conn->mtp3_link); + talloc_free(conn->mtp3_link_set); + + return 0; +} + /** Add a route to an m3ua_association * */ @@ -195,7 +203,8 @@ static int event_link_up(TALLOC_CTX *ctx, sigtran_conn_t **out, sigtran_conn_con conn = talloc_zero(ctx, sigtran_conn_t); conn->conf = conf; - conn->bsc_data = bsc_data_alloc(ctx); + conn->bsc_data = bsc_data_alloc(conn; + talloc_set_destructor(conn, _conn_free); /* * Create a new link. This will run over SCTP/M3UA diff --git a/src/modules/rlm_sigtran/libosmo-m3ua/sctp_m3ua_client.c b/src/modules/rlm_sigtran/libosmo-m3ua/sctp_m3ua_client.c index 2e14f277f82..3a3e803851e 100644 --- a/src/modules/rlm_sigtran/libosmo-m3ua/sctp_m3ua_client.c +++ b/src/modules/rlm_sigtran/libosmo-m3ua/sctp_m3ua_client.c @@ -557,8 +557,14 @@ static int m3ua_shutdown(struct mtp_link *mtp_link) struct mtp_m3ua_client_link *link = mtp_link->data; if (link->asptm_active) { - /* need to allow the event loop to actually send the message */ + /* clear pending events */ + osmo_timer_del(&link->connect_timer); + osmo_timer_del(&link->t_beat); + osmo_timer_del(&link->t_ack); + m3ua_send_aspdn(link); + + /* need to allow the event loop to actually send the message */ schedule_aspdn_t_ack(link); } else clear_link(link);