From 24b4a30a097f8e05cabf971086391db2a10de88c Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 23 Jan 2013 00:23:26 +0000 Subject: [PATCH] Attempt to be more helpful when using a bad ao2 object pointer. Put the external obj pointer in the message instead of the internal version. ........ Merged revisions 379963 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@379964 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/astobj2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/astobj2.c b/main/astobj2.c index 0f4f2e05c5..f3fe7c6bdf 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -150,10 +150,12 @@ static inline struct astobj2 *INTERNAL_OBJ(void *user_data) p = (struct astobj2 *) ((char *) user_data - sizeof(*p)); if (AO2_MAGIC != p->priv_data.magic) { if (p->priv_data.magic) { - ast_log(LOG_ERROR, "bad magic number 0x%x for %p\n", p->priv_data.magic, p); + ast_log(LOG_ERROR, "bad magic number 0x%x for object %p\n", + p->priv_data.magic, user_data); } else { ast_log(LOG_ERROR, - "bad magic number for %p. Object is likely destroyed.\n", p); + "bad magic number for object %p. Object is likely destroyed.\n", + user_data); } return NULL; }