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