8011709: [parfait] False positive: memory leak in jdk/src/share/native/sun/font/layout/CanonShaping.cpp
authorjchen
Wed, 24 Jul 2013 12:40:26 -0700
changeset 19008 f013dabb0bf8
parent 19007 1e0c87e7edf7
child 19009 1f1914231324
8011709: [parfait] False positive: memory leak in jdk/src/share/native/sun/font/layout/CanonShaping.cpp Reviewed-by: jgodinez, prr
jdk/src/share/native/sun/font/layout/CanonShaping.cpp
--- a/jdk/src/share/native/sun/font/layout/CanonShaping.cpp	Wed Jul 24 13:38:17 2013 +0400
+++ b/jdk/src/share/native/sun/font/layout/CanonShaping.cpp	Wed Jul 24 12:40:26 2013 -0700
@@ -66,6 +66,16 @@
     le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount);
     le_int32 i;
 
+    if (combiningClasses == NULL || indices == NULL) {
+        if (combiningClasses != NULL) {
+            LE_DELETE_ARRAY(combiningClasses);
+        }
+        if (indices != NULL) {
+            LE_DELETE_ARRAY(indices);
+        }
+        return;
+    }
+
     for (i = 0; i < charCount; i += 1) {
       combiningClasses[i] = classTable->getGlyphClass(classTable, (LEGlyphID) inChars[i], success);
         indices[i] = i;