Fix memory leak in verifier.
We create std::ostringstream objects for failure messages but it appears we did
not delete them upon destruction. This CL fixes this.
Change-Id: If95c6f1b154db9c1d49ade4c1384ef6015663419
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index ed64307..c7b8a74 100644
--- a/runtime/verifier/method_verifier.h
+++ b/runtime/verifier/method_verifier.h
@@ -230,6 +230,10 @@
uint32_t access_flags, bool can_load_classes, bool allow_soft_failures)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ ~MethodVerifier() {
+ STLDeleteElements(&failure_messages_);
+ }
+
// Run verification on the method. Returns true if verification completes and false if the input
// has an irrecoverable corruption.
bool Verify() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);