Re: [PATCH i-g-t 1/4] core: Free buffer allocated with vasprintf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 09, 2014 at 01:56:02PM +0200, Daniel Vetter wrote:
> On Wed, Jul 09, 2014 at 11:45:18AM +0100, Damien Lespiau wrote:
> > We were leaking a bit.
> > 
> > Signed-off-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>
> > ---
> >  lib/igt_core.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/lib/igt_core.c b/lib/igt_core.c
> > index 7ac7ebe..364cdd0 100644
> > --- a/lib/igt_core.c
> > +++ b/lib/igt_core.c
> > @@ -591,6 +591,8 @@ void __igt_skip_check(const char *file, const int line,
> >  			 "Last errno: %i, %s\n"
> >  			 "Test requirement: (%s)\n%s",
> >  			 func, file, line, err, strerror(err), check, buf);
> > +
> > +		free(buf);
> 
> igt_skip is noreturn, i.e. this adds dead code. No idea how this fix this
> without causing a mess.
> 
> /me summons the devil and wishes for a garbage collector

Oh well, if it's no return it'll be freed for us anwyay. Will push the
other ones with the free removed in the last one.

-- 
Damien
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux