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>
This commit is contained in:
Ian Romanick 2013-04-16 09:31:08 -07:00
parent 50064164a4
commit 505ac6ddc6
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,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;