Commit: Close memory leaks in chew

Andreas Schwab schwab@suse.de
Mon Aug 8 11:53:00 GMT 2016


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



More information about the Binutils mailing list