introduce talloc all over OpenBSC
diff --git a/openbsc/src/telnet_interface.c b/openbsc/src/telnet_interface.c
index f4ffb52..8b9fd79 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 @@
 	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 @@
 	}
 
 
-	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;