i915,i965: Fix memory leak in try_pbo_upload (v2)
authorVinson Lee <vlee@freedesktop.org>
Fri, 2 Aug 2013 06:04:27 +0000 (23:04 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Thu, 15 Aug 2013 17:37:22 +0000 (10:37 -0700)
Fixes "Resource leak" defect reported by Coverity.
Tested on Haswell, no Piglit regressions.

v2: Apply to i965, not just i915. (chadv)

CC: "9.2, 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i915/intel_tex_image.c
src/mesa/drivers/dri/i965/intel_tex_image.c

index 9b1336d7593970501b849e31e6799a87690e83bf..975e77aa572893a302c93f3e0d2b75c75d95bbb8 100644 (file)
@@ -171,6 +171,7 @@ try_pbo_upload(struct gl_context *ctx,
                            0, 0, false,
                            image->Width, image->Height, GL_COPY)) {
       DBG("%s: blit failed\n", __FUNCTION__);
+      intel_miptree_release(&pbo_mt);
       return false;
    }
 
index 7db0deb50dbaa3b12c8cf6b2b5a3fda4e19aa055..f270862b65dfe20d35aaeca6afdb7dc9f6ae601d 100644 (file)
@@ -173,6 +173,7 @@ try_pbo_upload(struct gl_context *ctx,
                            0, 0, false,
                            image->Width, image->Height, GL_COPY)) {
       DBG("%s: blit failed\n", __FUNCTION__);
+      intel_miptree_release(&pbo_mt);
       return false;
    }