changeset 7694:db2e3a686cf3

8011709: [parfait] False positive: memory leak in jdk/src/share/native/sun/font/layout/CanonShaping.cpp Reviewed-by: jgodinez, prr
author jchen
date Wed, 24 Jul 2013 12:40:26 -0700
parents 784589c7bc55
children c2e27e7a42ae
files src/share/native/sun/font/layout/CanonShaping.cpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/CanonShaping.cpp	Wed Jul 24 13:38:17 2013 +0400
+++ b/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;