From: Eric Engestrom Date: Sun, 10 Jun 2018 17:42:45 +0000 (+0100) Subject: i965: fix resource leak X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e43c012433186481219146a988cf2dbc15352802;p=mesa.git i965: fix resource leak v2: intel_miptree_release() already takes care of the planes, no need to hand-code the loop (Lionel) Coverity ID: 1436909 Fixes: 3352f2d746d3959b22ca4 "i965: Create multiple miptrees for planar YUV images" Reviewed-by: Lionel Landwerlin Signed-off-by: Eric Engestrom --- diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 69024c0678b..6b89bf6848a 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -927,8 +927,10 @@ miptree_create_for_planar_image(struct brw_context *brw, image->strides[index], tiling, MIPTREE_CREATE_NO_AUX); - if (mt == NULL) + if (mt == NULL) { + intel_miptree_release(&planar_mt); return NULL; + } mt->target = target;