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
(cherry picked from commit 33691abbc43850fd2b2951256c4b6bbc9733ccc8)
diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h
index 5c06cd5..e541096 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_);