GNU bug report logs - #47384
[PATCH 1/2] hostname: fix a memory leak with -Dlint

Previous Next

Package: coreutils;

Reported by: Kamil Dudka <kdudka <at> redhat.com>

Date: Thu, 25 Mar 2021 10:59:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kamil Dudka <kdudka <at> redhat.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 47384 <at> debbugs.gnu.org
Subject: bug#47384: [PATCH 1/2] hostname: fix a memory leak with -Dlint
Date: Thu, 25 Mar 2021 17:08:50 +0100
On Thursday, March 25, 2021 4:56:15 PM CET Paul Eggert wrote:
> On 3/25/21 3:57 AM, Kamil Dudka wrote:
> > +#ifdef lint
> > +      free(hostname);
> > +#endif
> 
> Let's not do this one. The program is about to exit so there's no need
> to free, and any static-checking tool that complains about a missing
> 'free' here is issuing a false alarm. On this particular issue it's
> better to fix the tools than to clutter upb source code to pacify them.

Wasn't that exactly what -Dlint was for when we discussed it the last time?
I am totally lost in your reasoning again.  But thank you for having a look.

Kamil






This bug report was last modified 4 years and 56 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.