summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-08 09:18:09 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-08 09:18:09 +0200
commit5a701ac80bc219d85ad3cb7c6877566fb7499894 (patch)
tree1bf928df08f76fbf4fffa276df6cb784105320ef
parentd717c7b27e1cd0b89c9557841c81f283494c1c08 (diff)
Patch to enable debugging of where xua_msg_alloc() is called fromlaforge/xua-memdebug
-rw-r--r--include/osmocom/sigtran/xua_msg.h3
-rw-r--r--src/xua_msg.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h
index e0e1bcf..e3e6dfa 100644
--- a/include/osmocom/sigtran/xua_msg.h
+++ b/include/osmocom/sigtran/xua_msg.h
@@ -69,7 +69,8 @@ struct xua_msg_event_map {
extern const struct xua_dialect xua_dialect_sua;
extern const struct xua_dialect xua_dialect_m3ua;
-struct xua_msg *xua_msg_alloc(void);
+#define xua_msg_alloc() _xua_msg_alloc(__FILE__, __LINE__)
+struct xua_msg *_xua_msg_alloc(const char *name, int line);
void xua_msg_free(struct xua_msg *msg);
int xua_msg_add_data(struct xua_msg *msg, uint16_t tag, uint16_t len, uint8_t *dat);
diff --git a/src/xua_msg.c b/src/xua_msg.c
index cb487c8..0eab51b 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -33,13 +33,14 @@
static void *tall_xua;
-struct xua_msg *xua_msg_alloc(void)
+struct xua_msg *_xua_msg_alloc(const char *file_name, int line)
{
struct xua_msg *msg;
msg = talloc_zero(tall_xua, struct xua_msg);
if (!msg)
return NULL;
+ talloc_set_name(msg, "%s:%u", file_name, line);
INIT_LLIST_HEAD(&msg->headers);
return msg;