Attempt to be more helpful when using a bad ao2 object pointer.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 23 Jan 2013 00:30:00 +0000 (00:30 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 23 Jan 2013 00:30:00 +0000 (00:30 +0000)
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
........

Merged revisions 379964 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379966 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/astobj2.c

index 50e81cf..e1fb81b 100644 (file)
@@ -159,10 +159,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) {
        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,
                } 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;
        }
                }
                return NULL;
        }