aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/telnet_interface.c
diff options
context:
space:
mode:
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;