From: David M. Lee Date: Fri, 13 Sep 2013 20:49:33 +0000 (+0000) Subject: Don't write to /tmp/refs when REF_DEBUG is not defined. X-Git-Tag: 11.6.0-rc1~3^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb51ba1688d2bc8b5d4f24ea1c2139603fdf62f4;p=thirdparty%2Fasterisk.git Don't write to /tmp/refs when REF_DEBUG is not defined. If MALLOC_DEBUG is enabled, then the debug destructor for the container is used, which would erroneously write to /tmp/refs. This patch only uses the debug destructor if ref_debug is used. (closes issue ASTERISK-22536) ........ Merged revisions 399098 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@399099 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/astobj2.c b/main/astobj2.c index 761027679b..a9e0d7a361 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -842,7 +842,7 @@ struct ao2_container *__ao2_container_alloc_debug(unsigned int options, /* compute the container size */ unsigned int num_buckets = hash_fn ? n_buckets : 1; size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket); - struct ao2_container *c = __ao2_alloc_debug(container_size, container_destruct_debug, options, tag, file, line, func, ref_debug); + struct ao2_container *c = __ao2_alloc_debug(container_size, ref_debug ? container_destruct_debug : container_destruct, options, tag, file, line, func, ref_debug); return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn); }