[Mesa-dev] [PATCH] mesa: Fix memory leak in generate_mipmap_compressed.

Kenneth Graunke kenneth at whitecape.org
Mon Mar 26 09:21:31 PDT 2012


On 03/23/2012 11:16 PM, Vinson Lee wrote:
> Fixes Coverity resource leak defect.
>
> NOTE: This is candidate for the 8.0 branch.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
>   src/mesa/main/mipmap.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
> index 756316a..abd26b8 100644
> --- a/src/mesa/main/mipmap.c
> +++ b/src/mesa/main/mipmap.c
> @@ -2128,6 +2128,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
>                                         dstWidth, dstHeight, dstDepth,
>                                         border, srcImage->InternalFormat,
>                                         srcImage->TexFormat)) {
> +         free(temp_dst);
>            return;
>         }

Yep, this is correct.  Thanks.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list