public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: jb <jb.1234abcd@gmail.com>
To: netdev@vger.kernel.org
Subject: Re: [PATCH] iputils: fix memory leaks
Date: Thu, 7 Mar 2013 11:18:21 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130307T121410-568@post.gmane.org> (raw)
In-Reply-To: AE90C24D6B3A694183C094C60CF0A2F6026B7181@saturn3.aculab.com

David Laight <David.Laight <at> ACULAB.COM> writes:

> 
> >     Fix memory leaks
> ...
> > +#ifdef USE_IDN
> > +                               free(idn);
> > +                               idn = NULL;
> > +#endif
> >                                 exit(2);
> 
> There is no point calling free() before exit(), nor any need
> to free items that aren't allocated inside loops.
> 
> 	David

A matter of good style ? Overzealous ?
Flame ?
http://stackoverflow.com/questions/654754/what-really-happens-when-you-dont-free-after-malloc
jb

      reply	other threads:[~2013-03-07 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  9:52 [PATCH] iputils: fix memory leaks jb
2013-03-07 10:06 ` David Laight
2013-03-07 11:18   ` jb [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=loom.20130307T121410-568@post.gmane.org \
    --to=jb.1234abcd@gmail.com \
    --cc=netdev@vger.kernel.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