public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 1/4] core: Free buffer allocated with vasprintf()
Date: Wed, 9 Jul 2014 14:14:37 +0200	[thread overview]
Message-ID: <20140709121437.GS17271@phenom.ffwll.local> (raw)
In-Reply-To: <20140709120608.GB341@strange.amr.corp.intel.com>

On Wed, Jul 09, 2014 at 01:06:08PM +0100, Damien Lespiau wrote:
> 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@intel.com>
> > > ---
> > >  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.

Well it does a longjump and will continue execution with the next subtest.
It's only a process exit if this isn't a subtest igt binary.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2014-07-09 12:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 10:45 [PATCH i-g-t 1/4] core: Free buffer allocated with vasprintf() Damien Lespiau
2014-07-09 10:45 ` [PATCH i-g-t 2/4] core: Put the requirement failure messages together Damien Lespiau
2014-07-09 10:45 ` [PATCH i-g-t 3/4] core: Only display the errno message if errno is set Damien Lespiau
2014-07-09 11:57   ` Daniel Vetter
2014-07-09 10:45 ` [PATCH i-g-t 4/4] core: Apply the same treatment to the in errno message in __igt_fail_assert() Damien Lespiau
2014-07-09 11:58   ` Daniel Vetter
2014-07-09 11:56 ` [PATCH i-g-t 1/4] core: Free buffer allocated with vasprintf() Daniel Vetter
2014-07-09 12:06   ` Damien Lespiau
2014-07-09 12:14     ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140709121437.GS17271@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox