Ensure OpenDexFilesFromImage closes file to prevent file descriptor leak
(cherry picked from commit 645e477c2ce7a59ac98bc86463826cf082a13ad8)
Test: m -j32 test-art-host
Bug: 32095919
Change-Id: I44541edeb403a508e1b9794ee09fb1f55e3f42bf
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 9c0d2db..9024aaa 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -829,7 +829,7 @@
if (file.get() == nullptr) {
return false;
}
- std::unique_ptr<ElfFile> elf_file(ElfFile::Open(file.release(),
+ std::unique_ptr<ElfFile> elf_file(ElfFile::Open(file.get(),
false /* writable */,
false /* program_header_only */,
false /* low_4gb */,