summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-03-13 16:54:54 -0700
committerAndreas Gampe <agampe@google.com>2015-03-13 16:54:54 -0700
commit0b7fcf94bdf8880862eb305454714a72da04cedb (patch)
tree7ba7dc4a8c673a2a30c72c2cbf45b6d7c1490739 /compiler/image_writer.cc
parent2f709af007ea67ee8b6b8965a7ce313bcb6089d4 (diff)
downloadart-0b7fcf94bdf8880862eb305454714a72da04cedb.zip
art-0b7fcf94bdf8880862eb305454714a72da04cedb.tar.gz
art-0b7fcf94bdf8880862eb305454714a72da04cedb.tar.bz2
ART: Fix missing Erase() in error case
Fixes an abort for unclosed file. Change-Id: Iae46fd89724f6f77a2b0a8c40293532e56153c2e
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index c7f81ea..d238b2c 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -137,6 +137,7 @@ bool ImageWriter::Write(const std::string& image_filename,
if (oat_file_ == nullptr) {
PLOG(ERROR) << "Failed to open writable oat file " << oat_filename << " for " << oat_location
<< ": " << error_msg;
+ oat_file->Erase();
return false;
}
CHECK_EQ(class_linker->RegisterOatFile(oat_file_), oat_file_);