Fix an asan found leak.

I will make better use of std::unique_ptr in followup patch.

llvm-svn: 256310
This commit is contained in:
Rafael Espindola 2015-12-23 01:14:37 +00:00
parent 5f2c46d62e
commit 05b0375e93
1 changed files with 3 additions and 1 deletions

View File

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