From: Juha-Pekka Heikkila Date: Mon, 2 Dec 2013 09:39:00 +0000 (-0700) Subject: glx: Check malloc return value before accessing memory in glx/clientattrib.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8875cb7c822ad366625a532dd9209d1647771af;p=mesa.git glx: Check malloc return value before accessing memory in glx/clientattrib.c Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Brian Paul --- diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c index 1b306eab120..37f14c541a5 100644 --- a/src/glx/clientattrib.c +++ b/src/glx/clientattrib.c @@ -76,6 +76,10 @@ __indirect_glPushClientAttrib(GLuint mask) if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) { if (!(sp = *spp)) { sp = malloc(sizeof(__GLXattribute)); + if (sp == NULL) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } *spp = sp; } sp->mask = mask;