i915,i965: Fix memory leak in try_pbo_upload (v2)

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>
This commit is contained in:
Vinson Lee 2013-08-01 23:04:27 -07:00 committed by Chad Versace
parent 6ca18e06ae
commit 035bf21983
2 changed files with 2 additions and 0 deletions

View 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;
}

View 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;
}