[lld] r286193 - [ELF] Don't leak the ".data" section. Fixes an asan failure.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 17:42:38 PST 2016


Author: davide
Date: Mon Nov  7 19:42:38 2016
New Revision: 286193

URL: http://llvm.org/viewvc/llvm-project?rev=286193&view=rev
Log:
[ELF] Don't leak the ".data" section. Fixes an asan failure.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=286193&r1=286192&r2=286193&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon Nov  7 19:42:38 2016
@@ -820,7 +820,7 @@ template <class ELFT> void BinaryFile::p
   StringRef SizeName = Saver.save(Twine(Filename) + "_size");
 
   auto *Section =
-      new InputSection<ELFT>(SHF_ALLOC, SHT_PROGBITS, 8, Data, ".data");
+      make<InputSection<ELFT>>(SHF_ALLOC, SHT_PROGBITS, 8, Data, ".data");
   Sections.push_back(Section);
 
   elf::Symtab<ELFT>::X->addRegular(StartName, STV_DEFAULT, Section, STB_GLOBAL,




More information about the llvm-commits mailing list