forked from Imagelibrary/binutils-gdb
gas tc_gen_reloc memory leaks
This makes all the tc_gen_reloc functions and the associated array in write.c:write_relocs use notes_alloc rather than malloc. tc-hppa.c tc_gen_reloc gets a few more changes, deleting some dead code, and tidying code that duplicates prior initialisation.
This commit is contained in:
@@ -1032,11 +1032,10 @@ tc_gen_reloc (asection *sec, fixS *fx)
|
||||
|| fx->fx_r_type == BFD_RELOC_M32C_RL_1ADDR
|
||||
|| fx->fx_r_type == BFD_RELOC_M32C_RL_2ADDR)
|
||||
{
|
||||
arelent * reloc;
|
||||
arelent *reloc;
|
||||
|
||||
reloc = XNEW (arelent);
|
||||
|
||||
reloc->sym_ptr_ptr = XNEW (asymbol *);
|
||||
reloc = notes_alloc (sizeof (arelent));
|
||||
reloc->sym_ptr_ptr = notes_alloc (sizeof (asymbol *));
|
||||
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fx->fx_addsy);
|
||||
reloc->address = fx->fx_frag->fr_address + fx->fx_where;
|
||||
reloc->howto = bfd_reloc_type_lookup (stdoutput, fx->fx_r_type);
|
||||
|
||||
Reference in New Issue
Block a user