[Mesa-dev] [PATCH] mesa: fix a leak in _mesa_delete_texture_image()

Pekka Paalanen ppaalanen at gmail.com
Fri Dec 16 08:20:45 PST 2011


On Fri, 16 Dec 2011 08:42:01 -0700
Brian Paul <brianp at vmware.com> wrote:

> On 12/16/2011 07:17 AM, Pekka Paalanen wrote:
> > Valgrind complains about a definitely lost block allocated in
> > intelNewTextureImage(). This leak was apparently created by
> > 6e0f9001fe3fb191c2928bd09aa9e9d05ddf4ea9, "mesa: move
> > gl_texture_image::Data, RowStride, ImageOffsets to swrast", as
> > it removes the free() from _mesa_delete_texture_image().
> >
> > Put the free() back, fixes a Valgrind error.
> >
> > Signed-off-by: Pekka Paalanen<ppaalanen at gmail.com>
> > Cc: Brian Paul<brianp at vmware.com>
> > ---
> >   src/mesa/main/teximage.c |    1 +
> >   1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> > index 8a002b6..6318cb1 100644
> > --- a/src/mesa/main/teximage.c
> > +++ b/src/mesa/main/teximage.c
> > @@ -604,6 +604,7 @@ _mesa_delete_texture_image(struct
> > gl_context *ctx, */
> >      ASSERT(ctx->Driver.FreeTextureImageBuffer);
> >      ctx->Driver.FreeTextureImageBuffer( ctx, texImage );
> > +   free(texImage);
> >   }
> >
> >
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>
> 
> Can you commit this?

I had commit access some years ago, I can try on Monday.

Thanks.

-- 
Pekka Paalanen
http://www.iki.fi/pq/


More information about the mesa-dev mailing list