diff options
author | Chad Versace <[email protected]> | 2011-12-27 10:10:05 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2011-12-29 10:47:44 -0800 |
commit | 747f0307626ef5bcf2f889ab66bcc95ab8eda2c8 (patch) | |
tree | ff3ec733bfcb558d48e33454865b15a10f28eb0f | |
parent | 069901e2f5a8f4a58047d25335f2526f1acc7234 (diff) |
intel: Fix memory leak in intel_miptree_create()
On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.
Reviewed-by: Eric Anholt <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 95764897d4f..60cc694ee0c 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -204,7 +204,7 @@ intel_miptree_create(struct intel_context *intel, * pitch == 0 || height == 0 indicates the null texture */ if (!mt || !mt->total_width || !mt->total_height) { - free(mt); + intel_miptree_release(&mt); return NULL; } @@ -216,7 +216,7 @@ intel_miptree_create(struct intel_context *intel, expect_accelerated_upload); if (!mt->region) { - free(mt); + intel_miptree_release(&mt); return NULL; } |