introduce talloc all over OpenBSC
diff --git a/openbsc/src/bsc_hack.c b/openbsc/src/bsc_hack.c
index 43f1011..ae67ade 100644
--- a/openbsc/src/bsc_hack.c
+++ b/openbsc/src/bsc_hack.c
@@ -47,6 +47,9 @@
 #include <openbsc/paging.h>
 #include <openbsc/e1_input.h>
 #include <openbsc/signal.h>
+#include <openbsc/talloc.h>
+
+void *tall_bsc_ctx;
 
 /* global pointer to the gsm network data structure */
 static struct gsm_network *gsmnet;
@@ -1078,7 +1081,7 @@
 static void handle_options(int argc, char** argv)
 {
 	while (1) {
-		int tmp, option_index = 0, c;
+		int option_index = 0, c;
 		static struct option long_options[] = {
 			{"help", 0, 0, 'h'},
 			{"debug", 1, 0, 'd'},
@@ -1170,6 +1173,9 @@
 	case SIGABRT:
 		shutdown_net(gsmnet);
 		break;
+	case SIGUSR1:
+		talloc_report_full(tall_bsc_ctx, stderr);
+		break;
 	default:
 		break;
 	}
@@ -1179,6 +1185,8 @@
 {
 	int rc;
 
+	tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc");
+
 	/* parse options */
 	handle_options(argc, argv);
 
@@ -1191,6 +1199,7 @@
 
 	signal(SIGHUP, &signal_handler);
 	signal(SIGABRT, &signal_handler);
+	signal(SIGUSR1, &signal_handler);
 
 	while (1) {
 		bsc_upqueue(gsmnet);