[PATCH] D27987: [ELF] - Fix use of freed memory.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 21 00:22:17 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL290238: [ELF] - Fix use of freed memory. (authored by grimar).

Changed prior to commit:
  https://reviews.llvm.org/D27987?vs=82107&id=82204#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27987

Files:
  lld/trunk/ELF/LinkerScript.cpp


Index: lld/trunk/ELF/LinkerScript.cpp
===================================================================
--- lld/trunk/ELF/LinkerScript.cpp
+++ lld/trunk/ELF/LinkerScript.cpp
@@ -1030,7 +1030,6 @@
 
   ScriptConfiguration &Opt = *ScriptConfig;
   bool IsUnderSysroot;
-  std::vector<std::unique_ptr<MemoryBuffer>> OwningMBs;
 };
 
 void ScriptParser::readDynamicList() {
@@ -1180,8 +1179,7 @@
     return;
   }
   std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
-  tokenize(MB->getMemBufferRef());
-  OwningMBs.push_back(std::move(MB));
+  tokenize({Saver.save(MB->getBuffer()), unquote(Tok)});
 }
 
 void ScriptParser::readOutput() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27987.82204.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161221/e17dc6e8/attachment.bin>


More information about the llvm-commits mailing list