diff options
author | Vinson Lee <[email protected]> | 2009-10-28 11:09:50 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-10-28 11:10:14 -0600 |
commit | a7d0665c00053839065592c339bfb298187a82be (patch) | |
tree | e4c0f46852a72cfe00eefb120bcdc6e4611a90d9 /src | |
parent | 93dae6761bc90bbd43b450d2673620ec189b2c7a (diff) |
intel: Fix memory leak in event of mip tree allocation failure
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 4 |
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, |