[lld] r256310 - Fix an asan found leak.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 22 17:14:37 PST 2015
Author: rafael
Date: Tue Dec 22 19:14:37 2015
New Revision: 256310
URL: http://llvm.org/viewvc/llvm-project?rev=256310&view=rev
Log:
Fix an asan found leak.
I will make better use of std::unique_ptr in followup patch.
Modified:
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=256310&r1=256309&r2=256310&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Dec 22 19:14:37 2015
@@ -60,8 +60,10 @@ void SymbolTable<ELFT>::addFile(std::uni
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();
More information about the llvm-commits
mailing list