aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/e1_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/e1_input.c')
-rw-r--r--openbsc/src/e1_input.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/openbsc/src/e1_input.c b/openbsc/src/e1_input.c
index 034bd9723..2d0c1340f 100644
--- a/openbsc/src/e1_input.c
+++ b/openbsc/src/e1_input.c
@@ -51,6 +51,7 @@
#include <openbsc/subchan_demux.h>
#include <openbsc/trau_frame.h>
#include <openbsc/trau_mux.h>
+#include <openbsc/talloc.h>
#define NUM_E1_TS 32
@@ -60,6 +61,8 @@ LLIST_HEAD(e1inp_driver_list);
/* list of all E1 lines */
LLIST_HEAD(e1inp_line_list);
+static void *tall_sigl_ctx;
+
/* to be implemented, e.g. by bsc_hack.c */
void input_event(int event, enum e1inp_sign_type type, struct gsm_bts_trx *trx);
@@ -233,6 +236,7 @@ int abis_rsl_sendmsg(struct msgb *msg)
if (!msg->trx || !msg->trx->rsl_link) {
fprintf(stderr, "rsl_sendmsg: msg->trx == NULL\n");
+ talloc_free(msg);
return -EINVAL;
}
@@ -366,12 +370,14 @@ e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
if (ts->type != E1INP_TS_TYPE_SIGN)
return NULL;
- link = malloc(sizeof(*link));
+ if (!tall_sigl_ctx)
+ tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1,
+ "e1inp_sign_link");
+
+ link = talloc_zero(tall_sigl_ctx, struct e1inp_sign_link);
if (!link)
return NULL;
- memset(link, 0, sizeof(*link));
-
link->ts = ts;
link->type = type;
INIT_LLIST_HEAD(&link->tx_list);
@@ -451,7 +457,7 @@ struct msgb *e1inp_tx_ts(struct e1inp_ts *e1i_ts,
}
break;
case E1INP_TS_TYPE_TRAU:
- msg = msgb_alloc(TSX_ALLOC_SIZE);
+ msg = msgb_alloc(TSX_ALLOC_SIZE, "TRAU_TX");
if (!msg)
return NULL;
len = subchan_mux_out(&e1i_ts->trau.mux, msg->data, 40);