diff options
author | serb <none@none> | 2014-07-30 00:00:22 +0400 |
---|---|---|
committer | serb <none@none> | 2014-07-30 00:00:22 +0400 |
commit | 129dfe6ff3874e264c04f217460ff5ba08c4beba (patch) | |
tree | 5fcdedb632901a2444e20aa262fdba7555d82169 /src/share/native/sun | |
parent | c3107b6e37b221c51524820c9136cab5bd594573 (diff) |
8048524: Memory leak in jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c
Reviewed-by: prr, serb
Contributed-by: Anton Melnikov <anton.melnikov@oracle.com>
Diffstat (limited to 'src/share/native/sun')
-rw-r--r-- | src/share/native/sun/awt/image/BufImgSurfaceData.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/share/native/sun/awt/image/BufImgSurfaceData.c b/src/share/native/sun/awt/image/BufImgSurfaceData.c index 6dc99aba2..e51f53a89 100644 --- a/src/share/native/sun/awt/image/BufImgSurfaceData.c +++ b/src/share/native/sun/awt/image/BufImgSurfaceData.c @@ -291,7 +291,12 @@ static ColorData *BufImg_SetupICM(JNIEnv *env, = (*env)->GetBooleanField(env, bisdo->icm, allGrayID); int *pRgb = (int *) ((*env)->GetPrimitiveArrayCritical(env, bisdo->lutarray, NULL)); - CHECK_NULL_RETURN(pRgb, (ColorData*)NULL); + + if (pRgb == NULL) { + free(cData); + return (ColorData*)NULL; + } + cData->img_clr_tbl = initCubemap(pRgb, bisdo->lutsize, 32); if (allGray == JNI_TRUE) { initInverseGrayLut(pRgb, bisdo->lutsize, cData); @@ -304,7 +309,13 @@ static ColorData *BufImg_SetupICM(JNIEnv *env, if (JNU_IsNull(env, colorData)) { jlong pData = ptr_to_jlong(cData); colorData = (*env)->NewObjectA(env, clsICMCD, initICMCDmID, (jvalue *)&pData); - JNU_CHECK_EXCEPTION_RETURN(env, (ColorData*)NULL); + + if ((*env)->ExceptionCheck(env)) + { + free(cData); + return (ColorData*)NULL; + } + (*env)->SetObjectField(env, bisdo->icm, colorDataID, colorData); } } |