[PATCH] D33964: [LLVM][llvm-objcopy] Added basic plumbing to get things started

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 14:50:44 PDT 2017


jakehehrlich marked 4 inline comments as done.
jakehehrlich added inline comments.


================
Comment at: tools/llvm-objcopy/Object.cpp:171
+  Flags = Ehdr.e_flags;
+  SectionNames = new StringTableSection();
+  SectionNames->Name = ".shstrtab";
----------------
Bigcheese wrote:
> Memory leak. Use unique_ptr.
It get's emplaced into the Sections vector first thing after allocation and that unique pointer manages the memory. Would be more obvious that a leak isn't occurring I first add a new unique pointer to Sections and then assign SectionNames via a cast from there?


Repository:
  rL LLVM

https://reviews.llvm.org/D33964





More information about the llvm-commits mailing list