if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
if (!(sp = *spp)) {
- sp = (__GLXattribute *) malloc(sizeof(__GLXattribute));
+ sp = malloc(sizeof(__GLXattribute));
+ if (sp == NULL) {
+ __glXSetError(gc, GL_OUT_OF_MEMORY);
+ return;
+ }
*spp = sp;
}
sp->mask = mask;