This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] Free memory returned from bfd_get_synthetic_symtab
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: binutils at sourceware dot org
- Date: Mon, 25 Sep 2017 16:27:18 -0700
- Subject: Re: [committed, PATCH] Free memory returned from bfd_get_synthetic_symtab
- Authentication-results: sourceware.org; auth=none
- References: <20170925210940.GA11989@gmail.com> <878th2a2dc.fsf@linux-m68k.org>
On 9/25/17, Andreas Schwab <schwab@linux-m68k.org> wrote:
> On Sep 25 2017, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>
>> @@ -1201,6 +1201,8 @@ display_rel_file (bfd *abfd, bfd *archive_bfd)
>> else
>> print_size_symbols (abfd, dynamic, symsizes, symcount, archive_bfd);
>>
>> + if (synthsyms)
>> + free (synthsyms);
>
> There is no need to check for NULL.
>
Are we assuming "free (NULL)" always works?
--
H.J.