aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2013-12-02 02:39:00 -0700
committerBrian Paul <[email protected]>2013-12-03 14:35:41 -0700
commitb8875cb7c822ad366625a532dd9209d1647771af (patch)
treed02fbe7ef8f285b3035545ca2a5def5fe6a7ce10
parent998018d7be1380f055fb577b0782004657cc9509 (diff)
glx: Check malloc return value before accessing memory in glx/clientattrib.c
Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Brian Paul <[email protected]>
-rw-r--r--src/glx/clientattrib.c4
1 files changed, 4 insertions, 0 deletions
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;