From 59cb8d4e8f9d16e193c139064c5c67d0820015d2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 20 Apr 2026 10:40:54 +1000 Subject: [PATCH] glx: handle strdup allocation failures Co-Authored-by: Claude Code Part-of: --- glx/clientinfo.c | 2 ++ glx/glxcmds.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/glx/clientinfo.c b/glx/clientinfo.c index cc148344b..b443729fb 100644 --- a/glx/clientinfo.c +++ b/glx/clientinfo.c @@ -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; } diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 148a4075d..3971809d4 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -2501,6 +2501,8 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc) free(cl->GLClientextensions); cl->GLClientextensions = strdup(buf); + if (!cl->GLClientextensions) + return BadAlloc; return Success; }