intel: Fix memory leak in event of mip tree allocation failure

Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Vinson Lee
2009-10-28 11:09:50 -06:00
committed by Brian Paul
parent 93dae6761b
commit a7d0665c00
@@ -134,8 +134,10 @@ intel_miptree_create(struct intel_context *intel,
/*
* pitch == 0 || height == 0 indicates the null texture
*/
if (!mt || !mt->pitch || !mt->total_height)
if (!mt || !mt->pitch || !mt->total_height) {
free(mt);
return NULL;
}
mt->region = intel_region_alloc(intel,
tiling,