diff options
author | 2018-08-09 07:29:05 -0700 | |
---|---|---|
committer | 2018-08-09 07:29:05 -0700 | |
commit | d6065142caf9de205fba35a85b82f95e55df2253 (patch) | |
tree | 8a579ced92b4c2a83cc1808dd5f3909f91823b19 | |
parent | 6e99db490fabbc38d96cc618a7aa82a99b3d07cf (diff) |
Remove copy and leak of dex data.
To implement class redefinition we need to keep around a copy of the
initial redefinition. We moved this to be done in ArtClassDefinition
but left code that allocated and copied the buffer in RedefineClasses.
This code did nothing but leak memory.
Test: ./test.py --host
Change-Id: Ide5eafc7eda57eb5b1fc02eccb26091eacfae84f
-rw-r--r-- | openjdkjvmti/ti_redefine.cc | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/openjdkjvmti/ti_redefine.cc b/openjdkjvmti/ti_redefine.cc index 1476880f45..dd0428dfcf 100644 --- a/openjdkjvmti/ti_redefine.cc +++ b/openjdkjvmti/ti_redefine.cc @@ -368,17 +368,6 @@ jvmtiError Redefiner::RedefineClasses(ArtJvmTiEnv* env, if (res != OK) { return res; } - // We make a copy of the class_bytes to pass into the retransformation. - // This makes cleanup easier (since we unambiguously own the bytes) and also is useful since we - // will need to keep the original bytes around unaltered for subsequent RetransformClasses calls - // to get the passed in bytes. - unsigned char* class_bytes_copy = nullptr; - res = env->Allocate(definitions[i].class_byte_count, &class_bytes_copy); - if (res != OK) { - return res; - } - memcpy(class_bytes_copy, definitions[i].class_bytes, definitions[i].class_byte_count); - ArtClassDefinition def; res = def.Init(self, definitions[i]); if (res != OK) { |