[ELF] Fix memory leak in BinaryFile handling.

llvm-svn: 281129
This commit is contained in:
Michael J. Spencer 2016-09-10 01:42:43 +00:00
parent 3354f42ae7
commit 0cb8a70adc
2 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,7 @@ void SymbolTable<ELFT>::addFile(std::unique_ptr<InputFile> File) {
// Binary file
if (auto *F = dyn_cast<BinaryFile>(FileP)) {
BinaryFiles.emplace_back(cast<BinaryFile>(File.release()));
addFile(F->createELF<ELFT>());
return;
}

View File

@ -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;