[asterisk-commits] dlee: branch 1.8 r399098 -	/branches/1.8/main/astobj2.c
    SVN commits to the Asterisk project 
    asterisk-commits at lists.digium.com
       
    Fri Sep 13 15:47:58 CDT 2013
    
    
  
Author: dlee
Date: Fri Sep 13 15:47:54 2013
New Revision: 399098
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399098
Log:
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)
Modified:
    branches/1.8/main/astobj2.c
Modified: branches/1.8/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/astobj2.c?view=diff&rev=399098&r1=399097&r2=399098
==============================================================================
--- branches/1.8/main/astobj2.c (original)
+++ branches/1.8/main/astobj2.c Fri Sep 13 15:47:54 2013
@@ -441,7 +441,7 @@
 	/* compute the container size */
 	const 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, tag, file, line, funcname, ref_debug);
+	struct ao2_container *c = __ao2_alloc_debug(container_size, ref_debug ? container_destruct_debug : container_destruct, tag, file, line, funcname, ref_debug);
 
 	return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
 }
    
    
More information about the asterisk-commits
mailing list