changeset 7831:b44ce67c0565

8013446: [parfait] Memory leak in jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c Reviewed-by: bae, prr
author vadim
date Fri, 16 Aug 2013 15:57:28 +0400
parents 2722f4000b65
children dadd43e02a79
files src/windows/native/sun/java2d/opengl/WGLSurfaceData.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c	Thu Aug 15 11:56:33 2013 -0700
+++ b/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;
     }