summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2013-09-27 22:20:04 -0700
committerChad Versace <[email protected]>2013-11-11 13:11:07 -0800
commit227872571ac57e47777fe1350fe9f5a355b5fbb8 (patch)
tree61920f3c7dc1a2cd8d1545334f80ef1ecdcf10ee /src/mesa/drivers/dri/i915
parentab2da985b67704ac556da591e227b41f3a2e1419 (diff)
i915, i965: Fix memory leak in intel_miptree_create_for_bo.
Fixes "Resource leak" defects reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/intel_mipmap_tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
index 66a7a92dc05..f0ad30cc9c9 100644
--- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
@@ -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;