summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2009-10-28 11:09:50 -0600
committerBrian Paul <[email protected]>2009-10-28 11:10:14 -0600
commita7d0665c00053839065592c339bfb298187a82be (patch)
treee4c0f46852a72cfe00eefb120bcdc6e4611a90d9
parent93dae6761bc90bbd43b450d2673620ec189b2c7a (diff)
intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <[email protected]>
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 0589d82db25..459e8fbd4b8 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -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,