[lld] r281129 - [ELF] Fix memory leak in BinaryFile handling.
Michael J. Spencer via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 9 18:42:43 PDT 2016
Author: mspencer
Date: Fri Sep 9 20:42:43 2016
New Revision: 281129
URL: http://llvm.org/viewvc/llvm-project?rev=281129&view=rev
Log:
[ELF] Fix memory leak in BinaryFile handling.
Modified:
lld/trunk/ELF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.h
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=281129&r1=281128&r2=281129&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Fri Sep 9 20:42:43 2016
@@ -55,6 +55,7 @@ void SymbolTable<ELFT>::addFile(std::uni
// Binary file
if (auto *F = dyn_cast<BinaryFile>(FileP)) {
+ BinaryFiles.emplace_back(cast<BinaryFile>(File.release()));
addFile(F->createELF<ELFT>());
return;
}
Modified: lld/trunk/ELF/SymbolTable.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.h?rev=281129&r1=281128&r2=281129&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.h (original)
+++ lld/trunk/ELF/SymbolTable.h Fri Sep 9 20:42:43 2016
@@ -127,6 +127,7 @@ private:
// The symbol table owns all file objects.
std::vector<std::unique_ptr<ArchiveFile>> ArchiveFiles;
+ std::vector<std::unique_ptr<BinaryFile>> BinaryFiles;
std::vector<std::unique_ptr<ObjectFile<ELFT>>> ObjectFiles;
std::vector<std::unique_ptr<LazyObjectFile>> LazyObjectFiles;
std::vector<std::unique_ptr<SharedFile<ELFT>>> SharedFiles;
More information about the llvm-commits
mailing list