From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH i-g-t 1/4] core: Free buffer allocated with vasprintf() Date: Wed, 9 Jul 2014 14:14:37 +0200 Message-ID: <20140709121437.GS17271@phenom.ffwll.local> References: <1404902721-9267-1-git-send-email-damien.lespiau@intel.com> <20140709115602.GO17271@phenom.ffwll.local> <20140709120608.GB341@strange.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by gabe.freedesktop.org (Postfix) with ESMTP id C96186E2D3 for ; Wed, 9 Jul 2014 05:14:26 -0700 (PDT) Received: by mail-wg0-f41.google.com with SMTP id k14so4694253wgh.12 for ; Wed, 09 Jul 2014 05:14:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140709120608.GB341@strange.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 > > > --- > > > 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