[PATCH 2/5] libXi: Fix memory leak in XIGetSelectedEvents

Pauli Nieminen ext-pauli.nieminen at nokia.com
Fri Jun 18 00:16:59 PDT 2010


On 17/06/10 17:54 +0200, ext Julien Cristau wrote:
> On Mon, Jun 14, 2010 at 11:47:32 +0300, Pauli Nieminen wrote:
> 
> > mask_in was leaking for every successfull XIGetSelectedEvents.
> > 
> > Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
> > ---
> >  src/XISelEv.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/XISelEv.c b/src/XISelEv.c
> > index bdc4fd1..3c1f018 100644
> > --- a/src/XISelEv.c
> > +++ b/src/XISelEv.c
> > @@ -161,6 +161,8 @@ XIGetSelectedEvents(Display* dpy, Window win, int *num_masks_return)
> >  
> >      *num_masks_return = reply.num_masks;
> >  
> > +    Xfree(mask_in);
> > +
> >      return mask_out;
> >  
> >  error:
> 
> Reviewed-by: Julien Cristau <jcristau at debian.org>
> 
> Looks like this function also doesn't UnlockDisplay() on various paths?
> 
> Cheers,
> Julien

Good catch. That file is very bad example how to handle display locking. 

I'm going to cook a patch for that too.


More information about the xorg-devel mailing list