[OpenJDK 2D-Dev] <AWT Dev> [PATCH] memory leak in LCMS.c

Phil Race Phil.Race at Sun.COM
Thu Nov 22 22:04:18 UTC 2007


This should be 2d-dev.

Alexey, can you take care of this.

thx,

-phil.

Thomas Fitzsimmons wrote:
> Hi,
>
> Java_sun_java2d_cmm_lcms_LCMS_loadProfile gets its data parameter's 
> byte array elements but does not release them.  A fix is attached.
>
> Tom
> ------------------------------------------------------------------------
>
> --- openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c.orig	2007-11-17 11:07:47.000000000 -0500
> +++ openjdk/jdk/src/share/native/sun/java2d/cmm/lcms/LCMS.c	2007-11-17 11:12:47.000000000 -0500
> @@ -182,6 +182,8 @@
>  
>      sProf.pf = cmsOpenProfileFromMem((LPVOID)dataArray, (DWORD) dataSize);
>  
> +    (*env)->ReleaseByteArrayElements (env, data, dataArray, 0);
> +
>      if (sProf.pf == NULL) {
>          JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
>      }
>   




More information about the 2d-dev mailing list