summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-10-28 11:09:50 -0600
committerBrian Paul <brianp@vmware.com>2009-10-28 11:10:14 -0600
commita7d0665c00053839065592c339bfb298187a82be (patch)
treee4c0f46852a72cfe00eefb120bcdc6e4611a90d9 /src/mesa/drivers
parent93dae6761bc90bbd43b450d2673620ec189b2c7a (diff)
intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/drivers')
-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 0589d82db2..459e8fbd4b 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,