8013446: [parfait] Memory leak in jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
authorvadim
Fri, 16 Aug 2013 15:57:28 +0400
changeset 19355 84011dfd634b
parent 19354 e5a4f2784bf2
child 19356 6f8b216b81bd
8013446: [parfait] Memory leak in jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c Reviewed-by: bae, prr
jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
--- a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c	Thu Aug 15 11:56:33 2013 -0700
+++ b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c	Fri Aug 16 15:57:28 2013 +0400
@@ -67,12 +67,13 @@
 
     J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
 
-    if (oglsdo == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+    if (wglsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
         return;
     }
-    if (wglsdo == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
+    if (oglsdo == NULL) {
+        free(wglsdo);
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
         return;
     }