mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
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:
parent
ab2da985b6
commit
227872571a
2 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue