8151110: libfontmanager should free memory with delete[] if it was allocated with new[]
authorpsadhukhan
Thu, 17 Mar 2016 12:48:25 +0530
changeset 36890 b1b7c1f2ad89
parent 36889 e36687a00487
child 36891 028eb2172cfc
8151110: libfontmanager should free memory with delete[] if it was allocated with new[] Reviewed-by: prr, serb
jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc
--- a/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc	Thu Mar 17 11:23:31 2016 +0530
+++ b/jdk/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc	Thu Mar 17 12:48:25 2016 +0530
@@ -293,7 +293,7 @@
       return NULL;
   }
   length = env->GetArrayLength(tableBytes);
-  buffer = new jbyte[length];
+  buffer = (jbyte *)calloc(length, sizeof(jbyte));
   env->GetByteArrayRegion(tableBytes, 0, length, buffer);
 
   return hb_blob_create((const char *)buffer, length,