summaryrefslogtreecommitdiff
path: root/main/logger.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-05-13 00:13:43 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-05-13 00:13:43 +0000
commitc524f905a6c7d6f4a0f5c3c97a8a761f1a166959 (patch)
treef37b70c464b220c367f37cfb491ae9503d6a72a5 /main/logger.c
parent68a37433bc9f1d4ff3e0784d4810b567636bdee7 (diff)
Two fixes found while debugging with ast_backtrace():
1) If MALLOC_DEBUG is used when concurrently using ast_backtrace, the free() used in that routine will trigger an error, because the memory was allocated internally to libc, where we could not intercept that call to wrap it. Therefore, it's not memory we knew about, and the free is reported as an error. 2) Now that channels are objects, the old hack of initializing a channel to all zeroes no longer works, since we may try to call something like ast_channel_lock() within a function on that reference. In that case, it's reported as an error, because the pointer isn't an object reference. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/logger.c b/main/logger.c
index bceaf092f..91ae572f9 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -1159,6 +1159,9 @@ void ast_backtrace(void)
for (i = 0; i < bt->num_frames; i++) {
ast_log(LOG_DEBUG, "#%d: [%p] %s\n", i, bt->addresses[i], strings[i]);
}
+
+ /* MALLOC_DEBUG will erroneously report an error here, unless we undef the macro. */
+#undef free
free(strings);
} else {
ast_debug(1, "Could not allocate memory for backtrace\n");