This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: Close memory leaks in chew
- From: Andreas Schwab <schwab at suse dot de>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 08 Aug 2016 13:53:40 +0200
- Subject: Re: Commit: Close memory leaks in chew
- Authentication-results: sourceware.org; auth=none
- References: <87h9avpkyn.fsf@redhat.com>
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."