intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user