summaryrefslogtreecommitdiff
path: root/lib/tsan/rtl/tsan_report.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-11-04 19:34:29 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-11-04 19:34:29 +0000
commit398c7e4f2ccbc25ed4bd567cb07da65e0238bc01 (patch)
tree56ef145f0875ab11ffc42bc677b1025d5b9a881c /lib/tsan/rtl/tsan_report.cc
parent85652664f7498c83aa0718728ad64a9304e7e869 (diff)
[Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan/rtl/tsan_report.cc')
-rw-r--r--lib/tsan/rtl/tsan_report.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/tsan/rtl/tsan_report.cc b/lib/tsan/rtl/tsan_report.cc
index d0cb0c30e..e2dbf345a 100644
--- a/lib/tsan/rtl/tsan_report.cc
+++ b/lib/tsan/rtl/tsan_report.cc
@@ -115,9 +115,7 @@ void PrintStack(const ReportStack *ent) {
if (ent->col)
Printf(":%d", ent->col);
if (ent->module && ent->offset) {
- char *stripped_module = StripModuleName(ent->module);
- Printf(" (%s+%p)\n", stripped_module, (void*)ent->offset);
- InternalFree(stripped_module);
+ Printf(" (%s+%p)\n", StripModuleName(ent->module), (void*)ent->offset);
} else {
Printf(" (%p)\n", (void*)ent->pc);
}
@@ -162,10 +160,8 @@ static void PrintLocation(const ReportLocation *loc) {
bool print_stack = false;
Printf("%s", d.Location());
if (loc->type == ReportLocationGlobal) {
- char *stripped_module = StripModuleName(loc->module);
- Printf(" Location is global '%s' of size %zu at %p (%s+%p)\n\n",
- loc->name, loc->size, loc->addr, stripped_module, loc->offset);
- InternalFree(stripped_module);
+ Printf(" Location is global '%s' of size %zu at %p (%s+%p)\n\n", loc->name,
+ loc->size, loc->addr, StripModuleName(loc->module), loc->offset);
} else if (loc->type == ReportLocationHeap) {
char thrbuf[kThreadBufSize];
Printf(" Location is heap block of size %zu at %p allocated by %s:\n",