diff options
author | 2016-10-17 15:18:09 +0000 | |
---|---|---|
committer | 2016-10-17 15:18:09 +0000 | |
commit | 498e122d91b441c5d6a4c2572d492028772e2cb8 (patch) | |
tree | 3a6b55fe477125b935d103712e7c970ff81158e0 /patchoat/patchoat.cc | |
parent | 174d17b2f70f009d5fa349bb94b1703297c36ec4 (diff) | |
parent | f5b0f2cef8554efaa90adc6a1ae04c2b533970ed (diff) |
Merge "Ensure OpenDexFilesFromImage closes file to prevent file descriptor leak"
Diffstat (limited to 'patchoat/patchoat.cc')
-rw-r--r-- | patchoat/patchoat.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index f3eb663cb8..c79bf92866 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -442,7 +442,7 @@ PatchOat::MaybePic PatchOat::IsOatPic(const ElfFile* oat_in) { return ERROR_OAT_FILE; } - const std::string& file_path = oat_in->GetFile().GetPath(); + const std::string& file_path = oat_in->GetFilePath(); const OatHeader* oat_header = GetOatHeader(oat_in); if (oat_header == nullptr) { @@ -846,7 +846,7 @@ bool PatchOat::PatchOatHeader(ElfFileImpl* oat_file) { } OatHeader* oat_header = reinterpret_cast<OatHeader*>(oat_file->Begin() + rodata_sec->sh_offset); if (!oat_header->IsValid()) { - LOG(ERROR) << "Elf file " << oat_file->GetFile().GetPath() << " has an invalid oat header"; + LOG(ERROR) << "Elf file " << oat_file->GetFilePath() << " has an invalid oat header"; return false; } oat_header->RelocateOat(delta_); @@ -854,10 +854,11 @@ bool PatchOat::PatchOatHeader(ElfFileImpl* oat_file) { } bool PatchOat::PatchElf() { - if (oat_file_->Is64Bit()) + if (oat_file_->Is64Bit()) { return PatchElf<ElfFileImpl64>(oat_file_->GetImpl64()); - else + } else { return PatchElf<ElfFileImpl32>(oat_file_->GetImpl32()); + } } template <typename ElfFileImpl> |