intel: Don't dereference a NULL pointer of calloc fails

The caller of NewTextureObject does the right thing if NULL is returned,
so this function should do the right thing too.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 505ac6ddc6)
This commit is contained in:
Ian Romanick 2013-04-16 09:31:08 -07:00
parent 9ef8b94e22
commit 1665f29c29

View file

@ -34,6 +34,10 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
(void) ctx;
DBG("%s\n", __FUNCTION__);
if (obj == NULL)
return NULL;
_mesa_initialize_texture_object(&obj->base, name, target);
obj->needs_validate = true;