[Mesa-dev] [PATCH 2/6] mesa: fix potential mem leak in generate_mipmap_compressed()

Vinson Lee vlee at vmware.com
Thu Dec 1 21:53:56 PST 2011


On Dec 1, 2011, at 4:45 PM, Brian Paul wrote:

> Fixes a coverity warning.
> ---
> 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 c621800..fd6e582 100644
> --- a/src/mesa/main/mipmap.c
> +++ b/src/mesa/main/mipmap.c
> @@ -2048,6 +2048,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
>       dstImage = _mesa_get_tex_image(ctx, texObj, target, level + 1);
>       if (!dstImage) {
>          _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
> +         free(temp_dst);
>          return;
>       }
> 
> -- 
> 1.7.3.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Reviewed-by: Vinson Lee <vlee at vmware.com>


More information about the mesa-dev mailing list