summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/SymbolTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index 7934aaa403b..39af5affc46 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -60,8 +60,10 @@ void SymbolTable<ELFT>::addFile(std::unique_ptr<InputFile> File) {
if (auto *F = dyn_cast<SharedFile<ELFT>>(FileP)) {
// DSOs are uniquified not by filename but by soname.
F->parseSoName();
- if (!IncludedSoNames.insert(F->getSoName()).second)
+ if (!IncludedSoNames.insert(F->getSoName()).second) {
+ delete FileP;
return;
+ }
SharedFiles.emplace_back(F);
F->parse();
OpenPOWER on IntegriCloud