glx: handle strdup allocation failures

Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184>
This commit is contained in:
Peter Hutterer 2026-04-20 10:40:54 +10:00 committed by Marge Bot
parent 6ae0869a40
commit 59cb8d4e8f
2 changed files with 4 additions and 0 deletions

View file

@ -71,6 +71,8 @@ set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req,
free(cl->GLClientextensions);
cl->GLClientextensions = strdup(gl_extensions);
if (!cl->GLClientextensions)
return BadAlloc;
return 0;
}

View file

@ -2501,6 +2501,8 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc)
free(cl->GLClientextensions);
cl->GLClientextensions = strdup(buf);
if (!cl->GLClientextensions)
return BadAlloc;
return Success;
}