This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Close memory leaks in chew


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]