mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 19:25:00 +00:00
lto: Fix gratuitous memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110756 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -188,7 +188,7 @@ void LTOModule::addObjCClass(GlobalVariable *clgv) {
|
|||||||
NameAndAttributes info;
|
NameAndAttributes info;
|
||||||
if (_undefines.find(superclassName.c_str()) == _undefines.end()) {
|
if (_undefines.find(superclassName.c_str()) == _undefines.end()) {
|
||||||
const char *symbolName = ::strdup(superclassName.c_str());
|
const char *symbolName = ::strdup(superclassName.c_str());
|
||||||
info.name = ::strdup(symbolName);
|
info.name = symbolName;
|
||||||
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
||||||
// string is owned by _undefines
|
// string is owned by _undefines
|
||||||
_undefines[info.name] = info;
|
_undefines[info.name] = info;
|
||||||
@@ -220,7 +220,7 @@ void LTOModule::addObjCCategory(GlobalVariable *clgv) {
|
|||||||
NameAndAttributes info;
|
NameAndAttributes info;
|
||||||
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
|
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
|
||||||
const char *symbolName = ::strdup(targetclassName.c_str());
|
const char *symbolName = ::strdup(targetclassName.c_str());
|
||||||
info.name = ::strdup(symbolName);
|
info.name = symbolName;
|
||||||
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
||||||
// string is owned by _undefines
|
// string is owned by _undefines
|
||||||
_undefines[info.name] = info;
|
_undefines[info.name] = info;
|
||||||
@@ -237,7 +237,7 @@ void LTOModule::addObjCClassRef(GlobalVariable *clgv) {
|
|||||||
NameAndAttributes info;
|
NameAndAttributes info;
|
||||||
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
|
if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
|
||||||
const char *symbolName = ::strdup(targetclassName.c_str());
|
const char *symbolName = ::strdup(targetclassName.c_str());
|
||||||
info.name = ::strdup(symbolName);
|
info.name = symbolName;
|
||||||
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
|
||||||
// string is owned by _undefines
|
// string is owned by _undefines
|
||||||
_undefines[info.name] = info;
|
_undefines[info.name] = info;
|
||||||
|
Reference in New Issue
Block a user