[svn-commits] kpfleming: trunk r192357 - in /trunk: include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 5 08:18:24 CDT 2009


Author: kpfleming
Date: Tue May  5 08:18:21 2009
New Revision: 192357

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=192357
Log:
Correct some flaws in the memory accounting code for stringfields and ao2 objects

Under some conditions, the memory allocation for stringfields and ao2 objects would not have supplied valid file/function names for MALLOC_DEBUG tracking, so this commit corrects that.


Modified:
    trunk/include/asterisk/stringfields.h
    trunk/main/astobj2.c
    trunk/main/utils.c

Modified: trunk/include/asterisk/stringfields.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/stringfields.h?view=diff&rev=192357&r1=192356&r2=192357
==============================================================================
--- trunk/include/asterisk/stringfields.h (original)
+++ trunk/include/asterisk/stringfields.h Tue May  5 08:18:21 2009
@@ -244,7 +244,7 @@
 
 /*! \brief free all memory - to be called before destroying the object */
 #define ast_string_field_free_memory(x)	\
-	__ast_string_field_init(&(x)->__field_mgr, &(x)->__field_mgr_pool, -1, NULL, 0, NULL)
+	__ast_string_field_init(&(x)->__field_mgr, &(x)->__field_mgr_pool, -1, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 /*!
  * \internal

Modified: trunk/main/astobj2.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/astobj2.c?view=diff&rev=192357&r1=192356&r2=192357
==============================================================================
--- trunk/main/astobj2.c (original)
+++ trunk/main/astobj2.c Tue May  5 08:18:21 2009
@@ -358,7 +358,7 @@
 
 void *__ao2_alloc(size_t data_size, ao2_destructor_fn destructor_fn)
 {
-	return internal_ao2_alloc(data_size, destructor_fn, NULL, 0, NULL);
+	return internal_ao2_alloc(data_size, destructor_fn, __FILE__, __LINE__, __FUNCTION__);
 }
 
 

Modified: trunk/main/utils.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/utils.c?view=diff&rev=192357&r1=192356&r2=192357
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Tue May  5 08:18:21 2009
@@ -1605,7 +1605,7 @@
 		if (add_string_pool(mgr, pool_head, new_size, mgr->owner_file, mgr->owner_line, mgr->owner_func))
 			return NULL;
 #else
-		if (add_string_pool(mgr, pool_head, new_size, NULL, 0, NULL))
+		if (add_string_pool(mgr, pool_head, new_size, __FILE__, __LINE__, __FUNCTION__))
 			return NULL;
 #endif
 	}




More information about the svn-commits mailing list