Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / glx / clientattrib.c
index 4721fe938fde94380061cf6675cb3b29cf7d792c..37f14c541a5e81ce196b336acbbec8b759cba563 100644 (file)
@@ -75,7 +75,11 @@ __indirect_glPushClientAttrib(GLuint mask)
 
    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;