Commit 747f0307 authored by Chad Versace's avatar Chad Versace
Browse files

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: Emma Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
parent 069901e2
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment