jdk/src/macosx/native/sun/awt/LWCToolkit.m
changeset 18232 b538b71fb429
parent 15988 6db6e40405cf
child 18274 7c4289125569
--- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Tue Apr 16 21:19:02 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Thu Apr 18 13:52:38 2013 +0100
@@ -37,6 +37,8 @@
 
 #import "sun_lwawt_macosx_LWCToolkit.h"
 
+#import "sizecalc.h"
+
 int gNumberOfButtons;
 jint* gButtonDownMasks;
 
@@ -202,7 +204,7 @@
     jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID);
     jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE);
 
-    gButtonDownMasks = (jint*)malloc(sizeof(jint) * gNumberOfButtons);
+    gButtonDownMasks = (jint*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), gNumberOfButtons);
     if (gButtonDownMasks == NULL) {
         gNumberOfButtons = 0;
         JNU_ThrowOutOfMemoryError(env, NULL);