aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/telnet_interface.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-06-20 22:36:41 +0200
committerHarald Welte <laforge@gnumonks.org>2009-06-20 22:36:41 +0200
commit2cf161be08795be4a074ba2b50fdd81ad1f4c35e (patch)
tree3d1be58cd835c41e74f2a0d6a293085da5389777 /openbsc/src/telnet_interface.c
parent879dc971ff61c8405a9bdb505b24ec66296ecb4f (diff)
introduce talloc all over OpenBSC
Diffstat (limited to 'openbsc/src/telnet_interface.c')
-rw-r--r--openbsc/src/telnet_interface.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/telnet_interface.c b/openbsc/src/telnet_interface.c
index f4ffb529e..8b9fd7983 100644
--- a/openbsc/src/telnet_interface.c
+++ b/openbsc/src/telnet_interface.c
@@ -34,6 +34,7 @@
#include <openbsc/abis_rsl.h>
#include <openbsc/paging.h>
#include <openbsc/signal.h>
+#include <openbsc/talloc.h>
#include <vty/buffer.h>
@@ -47,6 +48,8 @@
/* per connection data */
LLIST_HEAD(active_connections);
+static void *tall_telnet_ctx;
+
/* per network data */
static int telnet_new_connection(struct bsc_fd *fd, unsigned int what);
#if 0
@@ -66,6 +69,9 @@ void telnet_init(struct gsm_network *network, int port) {
struct sockaddr_in sock_addr;
int fd, on = 1;
+ tall_telnet_ctx = talloc_named_const(tall_bsc_ctx, 1,
+ "telnet_connection");
+
bsc_vty_init(network);
fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -161,7 +167,7 @@ static int telnet_new_connection(struct bsc_fd *fd, unsigned int what) {
}
- connection = (struct telnet_connection*)malloc(sizeof(*connection));
+ connection = talloc(tall_telnet_ctx, struct telnet_connection);
memset(connection, 0, sizeof(*connection));
connection->network = (struct gsm_network*)fd->data;
connection->fd.data = connection;