summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-11 00:11:17 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-11 00:11:17 +0000
commit8d0843dcffad90ba200663c5b3aca3ce1e362e96 (patch)
treee2de342b3326b9e7b9d89cf545b855a4ca281f3e /tools
parent9a1c189d9e7472f336f3c6d61be76bc46b25749e (diff)
downloadllvm-8d0843dcffad90ba200663c5b3aca3ce1e362e96.tar.gz
llvm-8d0843dcffad90ba200663c5b3aca3ce1e362e96.tar.bz2
llvm-8d0843dcffad90ba200663c5b3aca3ce1e362e96.tar.xz
lto: Fix gratuitous memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/LTOModule.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index 2ab59649ad..e329d508c8 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -188,7 +188,7 @@ void LTOModule::addObjCClass(GlobalVariable *clgv) {
NameAndAttributes info;
if (_undefines.find(superclassName.c_str()) == _undefines.end()) {
const char *symbolName = ::strdup(superclassName.c_str());
- info.name = ::strdup(symbolName);
+ info.name = symbolName;
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
// string is owned by _undefines
_undefines[info.name] = info;
@@ -220,7 +220,7 @@ void LTOModule::addObjCCategory(GlobalVariable *clgv) {
NameAndAttributes info;
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
const char *symbolName = ::strdup(targetclassName.c_str());
- info.name = ::strdup(symbolName);
+ info.name = symbolName;
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
// string is owned by _undefines
_undefines[info.name] = info;
@@ -237,7 +237,7 @@ void LTOModule::addObjCClassRef(GlobalVariable *clgv) {
NameAndAttributes info;
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
const char *symbolName = ::strdup(targetclassName.c_str());
- info.name = ::strdup(symbolName);
+ info.name = symbolName;
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
// string is owned by _undefines
_undefines[info.name] = info;