This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] bfd: alpha: Fix crash caused by double free
- From: Alan Modra <amodra at gmail dot com>
- To: James Clarke <jrtc27 at jrtc27 dot com>
- Cc: binutils at sourceware dot org, John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin dot de>, Michael Cree <mcree at orcon dot net dot nz>
- Date: Mon, 2 Jan 2017 15:44:45 +1030
- Subject: Re: [PATCH] bfd: alpha: Fix crash caused by double free
- Authentication-results: sourceware.org; auth=none
- References: <20161231123218.46385-1-jrtc27@jrtc27.com>
On Sat, Dec 31, 2016 at 12:32:18PM +0000, James Clarke wrote:
> @@ -3228,11 +3228,13 @@ elf64_alpha_relax_opt_call (struct alpha_relax_info *info, bfd_vma symval)
>
> if (!gpdisp || gpdisp->r_addend != 4)
> {
> - if (tsec_free)
> + if (tsec_free != NULL
> + && elf_section_data (info->tsec)->relocs != tsec_free)
> free (tsec_free);
> return 0;
> }
> - if (tsec_free)
> + if (tsec_free != NULL
> + && elf_section_data (info->tsec)->relocs != tsec_free)
> free (tsec_free);
> }
>
Please move the new test to the assignment of tsec_free. OK with that
change, thanks!
--
Alan Modra
Australia Development Lab, IBM