summaryrefslogtreecommitdiff
path: root/dex2oat
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2025-02-13 17:14:13 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2025-02-14 03:48:15 -0800
commit99f6baed65d610f178693e737610b102467927fd (patch)
tree0e20da1a850c35c5c0456acf05e4e66ac839948c /dex2oat
parent0b5b2f22f22b140e2b23da17c96de7120ed4f221 (diff)
Fix deallocation of OatHeader.
Introduce a helper method to deallocate it. Test: gtest and run-tests with asan Change-Id: I8cbdaf4025273759671f6cbe4b38e2634aeb4163
Diffstat (limited to 'dex2oat')
-rw-r--r--dex2oat/linker/oat_writer.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index c79dda3d8d..7415604ab6 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -655,9 +655,7 @@ void OatWriter::PrepareLayout(MultiOatRelativePatcher* relative_patcher) {
}
OatWriter::~OatWriter() {
- if (oat_header_ != nullptr) {
- operator delete (oat_header_, oat_header_->GetHeaderSize());
- }
+ OatHeader::Delete(oat_header_);
}
class OatWriter::DexMethodVisitor {