[OpenJDK 2D-Dev] [PATCH] Memory leak in LCMS.c

Roman Kennke roman.kennke at aicas.com
Thu Nov 6 20:36:45 UTC 2008


I found a memory leak in LCMS.c, where one ReleaseByteArrayElements()
call is missing in loadProfile(). I think the IcedTea people discovered
this independently and already included that in IcedTea and I believe
also in OpenJDK6, but it doesn't seem to be in JDK7 yet.

/Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
-------------- next part --------------
diff -r 7337308ff346 src/share/native/sun/java2d/cmm/lcms/LCMS.c
--- a/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Thu Nov 06 12:32:40 2008 +0100
+++ b/src/share/native/sun/java2d/cmm/lcms/LCMS.c	Thu Nov 06 12:33:11 2008 +0100
@@ -192,6 +192,8 @@
         JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
     }
 
+    (*env)->ReleaseByteArrayElements(env, data, dataArray, JNI_ABORT);
+
     return sProf.j;
 }
 


More information about the 2d-dev mailing list