aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/input
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/input')
-rw-r--r--openbsc/src/input/ipaccess.c7
-rw-r--r--openbsc/src/input/misdn.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c
index ea7f847c2..ccc178d17 100644
--- a/openbsc/src/input/ipaccess.c
+++ b/openbsc/src/input/ipaccess.c
@@ -42,6 +42,7 @@
#include <openbsc/subchan_demux.h>
#include <openbsc/e1_input.h>
#include <openbsc/ipaccess.h>
+#include <openbsc/talloc.h>
/* data structure for one E1 interface with A-bis */
struct ia_e1_handle {
@@ -429,7 +430,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
}
DEBUGP(DINP, "accept()ed new OML link from %s\n", inet_ntoa(sa.sin_addr));
- line = malloc(sizeof(*line));
+ line = talloc(tall_bsc_ctx, struct e1inp_line);
if (!line) {
close(ret);
return -ENOMEM;
@@ -467,7 +468,7 @@ static int rsl_listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
{
struct sockaddr_in sa;
socklen_t sa_len = sizeof(sa);
- struct bsc_fd *bfd = malloc(sizeof(*bfd));
+ struct bsc_fd *bfd = talloc(tall_bsc_ctx, struct bsc_fd);
int ret;
if (!(what & BSC_FD_READ))
@@ -581,7 +582,7 @@ int ipaccess_setup(struct gsm_network *gsmnet)
if (ret)
return ret;
- e1h = malloc(sizeof(*e1h));
+ e1h = talloc(tall_bsc_ctx, struct ia_e1_handle);
memset(e1h, 0, sizeof(*e1h));
e1h->gsmnet = gsmnet;
diff --git a/openbsc/src/input/misdn.c b/openbsc/src/input/misdn.c
index de8d41f21..44f09646d 100644
--- a/openbsc/src/input/misdn.c
+++ b/openbsc/src/input/misdn.c
@@ -47,6 +47,7 @@
#include <openbsc/abis_rsl.h>
#include <openbsc/subchan_demux.h>
#include <openbsc/e1_input.h>
+#include <openbsc/talloc.h>
/* data structure for one E1 interface with A-bis */
struct mi_e1_handle {
@@ -136,7 +137,7 @@ static int handle_ts1_read(struct bsc_fd *bfd)
link = e1inp_lookup_sign_link(e1i_ts, l2addr.tei, l2addr.sapi);
if (!link) {
DEBUGPC(DMI, "mISDN message for unknown sign_link\n");
- free(msg);
+ msgb_free(msg);
return -EINVAL;
}
/* save the channel number in the driver private struct */
@@ -483,7 +484,7 @@ int mi_setup(int cardnr, struct e1inp_line *line, int release_l2)
/* create the actual line instance */
/* FIXME: do this independent of driver registration */
- e1h = malloc(sizeof(*e1h));
+ e1h = talloc(tall_bsc_ctx, struct mi_e1_handle);
memset(e1h, 0, sizeof(*e1h));
e1h->cardnr = cardnr;