public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: Commit: Close memory leaks in chew
Date: Mon, 08 Aug 2016 11:53:00 -0000	[thread overview]
Message-ID: <mvm37mfwk6z.fsf@hawking.suse.de> (raw)
In-Reply-To: <87h9avpkyn.fsf@redhat.com> (Nick Clifton's message of "Mon, 08	Aug 2016 12:18:56 +0100")

On Mo, Aug 08 2016, Nick Clifton <nickc@redhat.com> wrote:

> diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c
> index 92b62cd..71c7e2d 100644
> --- a/bfd/doc/chew.c
> +++ b/bfd/doc/chew.c
> @@ -170,7 +170,9 @@ static void
>  delete_string (buffer)
>       string_type *buffer;
>  {
> -  free (buffer->ptr);
> +  if (buffer->ptr)
> +    free (buffer->ptr);

free (0) is a no-op.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

  reply	other threads:[~2016-08-08 11:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:19 Nick Clifton
2016-08-08 11:53 ` Andreas Schwab [this message]
2016-08-08 14:23   ` Nick Clifton

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=mvm37mfwk6z.fsf@hawking.suse.de \
    --to=schwab@suse.de \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).