summaryrefslogtreecommitdiffstats
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
commit4493c7e550de4be3c23d9a85d08fd156359efe0c (patch)
tree6dd5be5abb829fa7e62cb4ce81682fddb15fcd4a
parent2b4adffa16302bd75993f5a0c2f1a9f70af4dd38 (diff)
downloadbcm5719-llvm-4493c7e550de4be3c23d9a85d08fd156359efe0c.tar.gz
bcm5719-llvm-4493c7e550de4be3c23d9a85d08fd156359efe0c.zip
lto: Fix gratuitous memory leaks.
llvm-svn: 110756
-rw-r--r--llvm/tools/lto/LTOModule.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/lto/LTOModule.cpp b/llvm/tools/lto/LTOModule.cpp
index 2ab59649ada..e329d508c88 100644
--- a/llvm/tools/lto/LTOModule.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud