i915, i965: Fix memory leak in intel_miptree_create_for_bo.
Fixes "Resource leak" defects reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
@@ -264,8 +264,10 @@ intel_miptree_create_for_bo(struct intel_context *intel,
|
||||
0, 0,
|
||||
width, height, 1,
|
||||
true);
|
||||
if (!mt)
|
||||
if (!mt) {
|
||||
free(region);
|
||||
return mt;
|
||||
}
|
||||
|
||||
region->cpp = mt->cpp;
|
||||
region->width = width;
|
||||
|
||||
@@ -636,8 +636,10 @@ intel_miptree_create_for_bo(struct brw_context *brw,
|
||||
0, 0,
|
||||
width, height, 1,
|
||||
true, 0 /* num_samples */);
|
||||
if (!mt)
|
||||
if (!mt) {
|
||||
free(region);
|
||||
return mt;
|
||||
}
|
||||
|
||||
region->cpp = mt->cpp;
|
||||
region->width = width;
|
||||
|
||||
Reference in New Issue
Block a user