From 1420522c6e9abcc0a5247c3179d1730c942e9c24 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 1 May 2012 23:21:07 +0000 Subject: [PATCH] Fixed __ao2_ref() validating user_data twice. (closes issue ASTERISK-19755) Reported by: Gunther Kelleter Patches: ao2_ref.patch (license #6372) patch uploaded by Gunther Kelleter ........ Merged revisions 364902 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 364903 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364910 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/astobj2.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main/astobj2.c b/main/astobj2.c index 20d977ba39..b689dbbe57 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -514,7 +514,7 @@ int __ao2_ref_debug(void *user_data, int delta, const char *tag, const char *fil FILE *refo = fopen(REF_FILE, "a"); if (refo) { fprintf(refo, "%p %s%d %s:%d:%s (%s) [@%d]\n", user_data, (delta < 0 ? "" : "+"), - delta, file, line, func, tag, obj ? obj->priv_data.ref_counter : -1); + delta, file, line, func, tag, obj->priv_data.ref_counter); fclose(refo); } } @@ -530,11 +530,6 @@ int __ao2_ref_debug(void *user_data, int delta, const char *tag, const char *fil int __ao2_ref(void *user_data, int delta) { - struct astobj2 *obj = INTERNAL_OBJ(user_data); - - if (obj == NULL) - return -1; - return internal_ao2_ref(user_data, delta, __FILE__, __LINE__, __FUNCTION__); } -- 2.47.2