8005261: [parfait] #415 sun/java2d/opengl/GLXSurfaceData.c Memory leak of pointer 'glxsdo' allocated with malloc
Reviewed-by: prr, vadim
This commit is contained in:
parent
410876d0ee
commit
c3e1c6d07b
@ -57,22 +57,23 @@ Java_sun_java2d_opengl_GLXSurfaceData_initOps(JNIEnv *env, jobject glxsd,
|
|||||||
jobject peer, jlong aData)
|
jobject peer, jlong aData)
|
||||||
{
|
{
|
||||||
#ifndef HEADLESS
|
#ifndef HEADLESS
|
||||||
OGLSDOps *oglsdo = (OGLSDOps *)SurfaceData_InitOps(env, glxsd,
|
|
||||||
sizeof(OGLSDOps));
|
|
||||||
GLXSDOps *glxsdo = (GLXSDOps *)malloc(sizeof(GLXSDOps));
|
GLXSDOps *glxsdo = (GLXSDOps *)malloc(sizeof(GLXSDOps));
|
||||||
|
|
||||||
J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
|
|
||||||
|
|
||||||
if (oglsdo == NULL) {
|
|
||||||
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (glxsdo == NULL) {
|
if (glxsdo == NULL) {
|
||||||
JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
|
JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OGLSDOps *oglsdo = (OGLSDOps *)SurfaceData_InitOps(env, glxsd,
|
||||||
|
sizeof(OGLSDOps));
|
||||||
|
if (oglsdo == NULL) {
|
||||||
|
free(glxsdo);
|
||||||
|
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
|
||||||
|
|
||||||
oglsdo->privOps = glxsdo;
|
oglsdo->privOps = glxsdo;
|
||||||
|
|
||||||
oglsdo->sdOps.Lock = OGLSD_Lock;
|
oglsdo->sdOps.Lock = OGLSD_Lock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user