changeset 16704:d36913af8b3e

Merge
author lana
date Tue, 09 Apr 2013 14:59:22 -0700
parents f70e8440f306 5811e206dd2f
children 264e40b2ab20
files
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/macosx/native/sun/awt/CTextPipe.m	Thu Apr 04 19:05:32 2013 -0700
+++ b/jdk/src/macosx/native/sun/awt/CTextPipe.m	Tue Apr 09 14:59:22 2013 -0700
@@ -501,10 +501,22 @@
         int *uniChars = (int *)malloc(sizeof(int) * length);
         CGSize *advances = (CGSize *)malloc(sizeof(CGSize) * length);
 
-        if (glyphs == NULL || advances == NULL)
+        if (glyphs == NULL || uniChars == NULL || advances == NULL)
         {
             (*env)->DeleteLocalRef(env, glyphsArray);
             [NSException raise:NSMallocException format:@"%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__];
+            if (glyphs)
+            {
+                free(glyphs);
+            }
+            if (uniChars)
+            {
+                free(uniChars);
+            }
+            if (advances)
+            {
+                free(advances);
+            }
             return;
         }