summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-08-08 13:54:46 +0000
committerMatthew Jordan <mjordan@digium.com>2013-08-08 13:54:46 +0000
commit2a8219b64a2886457326e3f0d14317023d9f1652 (patch)
tree69567dc8165bb16f13c71795ae4c9e62fb088aa0
parent88bef0b3dd99e0f3a4cd0d3fd29a9d172dcd9663 (diff)
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'. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/utils.c b/main/utils.c
index 91e0a2ced..b19148b7d 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -862,7 +862,8 @@ static void append_backtrace_information(struct ast_str **str, struct ast_bt *bt
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");