aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/sigtran/xua_msg.h2
-rw-r--r--src/xua_msg.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h
index 423adbc..e912e02 100644
--- a/include/osmocom/sigtran/xua_msg.h
+++ b/include/osmocom/sigtran/xua_msg.h
@@ -69,6 +69,8 @@ struct xua_msg_event_map {
extern const struct xua_dialect xua_dialect_sua;
extern const struct xua_dialect xua_dialect_m3ua;
+void osmo_xua_msg_tall_ctx_init(void *ctx);
+
struct xua_msg *xua_msg_alloc(void);
void xua_msg_free(struct xua_msg *msg);
diff --git a/src/xua_msg.c b/src/xua_msg.c
index d56009f..ed0cdc7 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -33,7 +33,13 @@
#include <string.h>
#include <errno.h>
-static void *tall_xua;
+static void *tall_xua = NULL;
+
+/* Allocate the root talloc context used for xua_msg_alloc(). */
+void osmo_xua_msg_tall_ctx_init(void *ctx)
+{
+ tall_xua = talloc_named_const(ctx, 0, "xua_msg");
+}
struct xua_msg *xua_msg_alloc(void)
{