[llvm-branch-commits] [llvm-branch] r111405 - /llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 18 13:33:09 PDT 2010


Author: ddunbar
Date: Wed Aug 18 15:33:08 2010
New Revision: 111405

URL: http://llvm.org/viewvc/llvm-project?rev=111405&view=rev
Log:
Merge r110756:
--
Author: Daniel Dunbar <daniel at zuster.org>
Date:   Wed Aug 11 00:11:17 2010 +0000

    lto: Fix gratuitous memory leaks.

Modified:
    llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp

Modified: llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp?rev=111405&r1=111404&r2=111405&view=diff
==============================================================================
--- llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp (original)
+++ llvm/branches/Apple/williamson/tools/lto/LTOModule.cpp Wed Aug 18 15:33:08 2010
@@ -188,7 +188,7 @@
       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 @@
       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 @@
     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;





More information about the llvm-branch-commits mailing list