8363676: [GCC static analyzer] missing return value check of malloc in OGLContext_SetTransform

Reviewed-by: psadhukhan
This commit is contained in:
Matthias Baesken 2025-07-28 11:33:27 +00:00
parent 011de4c894
commit d25ad881eb

View File

@ -484,6 +484,7 @@ OGLContext_SetTransform(OGLContext *oglc,
if (oglc->xformMatrix == NULL) {
size_t arrsize = 16 * sizeof(GLdouble);
oglc->xformMatrix = (GLdouble *)malloc(arrsize);
RETURN_IF_NULL(oglc->xformMatrix);
memset(oglc->xformMatrix, 0, arrsize);
oglc->xformMatrix[10] = 1.0;
oglc->xformMatrix[15] = 1.0;