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: [PATCH] bfd: alpha: Fix crash caused by double free


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


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