[PATCH xf86-video-vesa 3/4] Use VBEFreeVBEInfo not free

Adam Jackson ajax at nwnk.net
Wed Jan 31 19:34:31 UTC 2018


On Wed, 2018-01-31 at 16:57 +0100, walter harms wrote:
> 
> Am 31.01.2018 16:48, schrieb Adam Jackson:
> > 
> > diff --git a/src/vesa.c b/src/vesa.c
> > index 3f5b81c..2d3c10d 100644
> > --- a/src/vesa.c
> > +++ b/src/vesa.c
> > @@ -596,7 +596,8 @@ VESAFreeRec(ScrnInfoPtr pScrn)
> >      }
> >  #endif
> >      free(pVesa->monitor);
> > -    free(pVesa->vbeInfo);
> > +    if (pVesa->vbeInfo)
> > +	VBEFreeVBEInfo(pVesa->vbeInfo);
> 
> since all free function accept NULL these days it may be more efficient to
> teach VBEFreeVBEInfo to accept NULL.

If I relied on that, then the driver would crash on exit when run
against an older server.

- ajax


More information about the xorg-devel mailing list