[asterisk-commits] mjordan: trunk r396391 - /trunk/main/utils.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 8 08:54:48 CDT 2013


Author: mjordan
Date: Thu Aug  8 08:54:46 2013
New Revision: 396391

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396391
Log:
Prevent spurious memory error when appending backtrace with MALLOC_DEBUG

Backtraces are allocated outside of the usual memory tracking performed by
MALLOC_DEBUG. This allows them to be used by the memory tracking enabled
by that build option; however, it also means that when backtraces are
disposed of they have to be done so outside of the re-defined free.

This patch undef's free prior to disposing of the allocated backtrace when
a backtrace is appended as a result of 'core show locks'.

Modified:
    trunk/main/utils.c

Modified: trunk/main/utils.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/utils.c?view=diff&rev=396391&r1=396390&r2=396391
==============================================================================
--- trunk/main/utils.c (original)
+++ trunk/main/utils.c Thu Aug  8 08:54:46 2013
@@ -862,7 +862,8 @@
 		for (frame_iterator = 0; frame_iterator < num_frames; ++frame_iterator) {
 			ast_str_append(str, 0, "\t%s\n", symbols[frame_iterator]);
 		}
-
+/* Prevent MALLOC_DEBUG from complaining */
+#undef free
 		free(symbols);
 	} else {
 		ast_str_append(str, 0, "\tCouldn't retrieve backtrace symbols\n");




More information about the asterisk-commits mailing list