--- 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);