[Mesa-dev] [PATCH] mesa: Fix memory leak in out-of-memory path.

Brian Paul brianp at vmware.com
Mon Oct 24 12:05:42 PDT 2011


On 10/24/2011 01:00 PM, Vinson Lee wrote:
> Fixes Coverity resource leak defect.
> ---
>   src/mesa/main/pack.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
> index 092e541..ecdeaf5 100644
> --- a/src/mesa/main/pack.c
> +++ b/src/mesa/main/pack.c
> @@ -3717,6 +3717,7 @@ _mesa_unpack_color_span_ubyte(struct gl_context *ctx,
>
>            if (!indexes) {
>               _mesa_error(ctx, GL_OUT_OF_MEMORY, "pixel unpacking");
> +            free(rgba);
>               return;
>            }
>

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list