changeset 39223:af5506aae343

8159019: ResourceMark in ClassLoader::open_versioned_entry() is being used incorrectly Summary: Call FREE_RESOURCE_ARRAY instead of declaring a ResourceMark Reviewed-by: hseigel, jiangli
author ccheung
date Wed, 08 Jun 2016 12:50:23 -0700
parents cf2d48fdf795
children ff6081f6f96b
files hotspot/src/share/vm/classfile/classLoader.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Jun 08 18:09:04 2016 +0200
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Wed Jun 08 12:50:23 2016 -0700
@@ -380,7 +380,6 @@
 
     if (is_multi_ver) {
       int n;
-      ResourceMark rm(THREAD);
       char* entry_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, JVM_MAXPATHLEN);
       if (version > 0) {
         n = jio_snprintf(entry_name, JVM_MAXPATHLEN, "META-INF/versions/%d/%s", version, name);
@@ -400,6 +399,7 @@
           }
         }
       }
+      FREE_RESOURCE_ARRAY(char, entry_name, JVM_MAXPATHLEN);
     }
   }
   return buffer;