[llvm] [BOLT] Fix memory leak in BinarySection (PR #82520)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 11:54:23 PST 2024


================
@@ -190,18 +190,7 @@ void BinarySection::flushPendingRelocations(raw_pwrite_stream &OS,
   clearList(PendingRelocations);
 }
 
-BinarySection::~BinarySection() {
-  if (isReordered()) {
----------------
maksfb wrote:

Now that we manage the memory inside `updateContents()` it's not needed and can lead to double-free.

https://github.com/llvm/llvm-project/pull/82520


More information about the llvm-commits mailing list