Module: Mesa Branch: master Commit: a7d0665c00053839065592c339bfb298187a82be URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7d0665c00053839065592c339bfb298187a82be
Author: Vinson Lee <[email protected]> Date: Wed Oct 28 11:09:50 2009 -0600 intel: Fix memory leak in event of mip tree allocation failure Signed-off-by: Brian Paul <[email protected]> --- 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 0589d82..459e8fb 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, _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
