From 9b5423b5f438ecb00aa67cf131c98b745ee1c0e2 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 11 Jul 2018 16:39:15 +0200 Subject: debug: log xua_msg_free() caller Change-Id: Ib3901d88ed5afe666f9eb4666dffa2afd941e67d --- include/osmocom/sigtran/xua_msg.h | 6 +++++- src/xua_msg.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h index 9c3c49c..99d3e78 100644 --- a/include/osmocom/sigtran/xua_msg.h +++ b/include/osmocom/sigtran/xua_msg.h @@ -73,7 +73,11 @@ void osmo_xua_msg_tall_ctx_init(void *ctx); #define xua_msg_alloc() _xua_msg_alloc(__FILE__, __LINE__) struct xua_msg *_xua_msg_alloc(const char *file, int line); -void xua_msg_free(struct xua_msg *msg); +#define xua_msg_free(msg) do { \ + printf("xua_msg_free(): %s:%d: %p\n", __FILE__, __LINE__, msg); \ + _xua_msg_free(msg); \ +}while(0) +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 21c48a3..e560af4 100644 --- a/src/xua_msg.c +++ b/src/xua_msg.c @@ -54,7 +54,7 @@ struct xua_msg *_xua_msg_alloc(const char *file, int line) return msg; } -void xua_msg_free(struct xua_msg *msg) +void _xua_msg_free(struct xua_msg *msg) { talloc_free(msg); } -- cgit v1.2.1