aboutsummaryrefslogtreecommitdiff
path: root/bfd/ecoff.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-05-20 17:25:20 +0930
committerAlan Modra <amodra@gmail.com>2020-05-21 10:11:57 +0930
commitc95949892f6f1e2974a0fb8a5463d7b6432ac469 (patch)
tree787ac00de8dc1bfb5170e2b2caf05e66d8ab6c7f /bfd/ecoff.c
parentc31ab5a0010ac9e3d31fd218fffcff1b9696363e (diff)
downloadgdb-c95949892f6f1e2974a0fb8a5463d7b6432ac469.zip
gdb-c95949892f6f1e2974a0fb8a5463d7b6432ac469.tar.gz
gdb-c95949892f6f1e2974a0fb8a5463d7b6432ac469.tar.bz2
Replace "if (x) free (x)" with "free (x)", bfd
* aoutx.h: Replace "if (x) free (x)" with "free (x)" throughout. * archive.c, * bfd.c, * bfdio.c, * coff-alpha.c, * coff-ppc.c, * coff-sh.c, * coff-stgo32.c, * coffcode.h, * coffgen.c, * cofflink.c, * cpu-arm.c, * doc/chew.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * elf-eh-frame.c, * elf-m10200.c, * elf-m10300.c, * elf-strtab.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-crx.c, * elf32-epiphany.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-ip2k.c, * elf32-m32c.c, * elf32-m68hc11.c, * elf32-m68k.c, * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c * elf64-mmix.c, * elf64-ppc.c, * elf64-sparc.c, * elfcode.h, * elflink.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-x86.c, * format.c, * ihex.c, * libbfd.c, * linker.c, * mmo.c, * opncls.c, * pdp11.c, * peXXigen.c, * pef.c, * peicode.h, * simple.c, * som.c, * srec.c, * stabs.c, * syms.c, * targets.c, * vms-lib.c, * xcofflink.c, * xtensa-isa.c: Likewise.
Diffstat (limited to 'bfd/ecoff.c')
-rw-r--r--bfd/ecoff.c63
1 files changed, 21 insertions, 42 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 1b0d423..dcded6f 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -488,12 +488,10 @@ ecoff_slurp_symbolic_header (bfd *abfd)
/* Now we can get the correct number of symbols. */
abfd->symcount = internal_symhdr->isymMax + internal_symhdr->iextMax;
- if (raw != NULL)
- free (raw);
+ free (raw);
return TRUE;
error_return:
- if (raw != NULL)
- free (raw);
+ free (raw);
return FALSE;
}
@@ -2797,14 +2795,12 @@ _bfd_ecoff_write_object_contents (bfd *abfd)
if (reloc_buff != NULL)
bfd_release (abfd, reloc_buff);
- if (buff != NULL)
- free (buff);
+ free (buff);
return TRUE;
error_return:
if (reloc_buff != NULL)
bfd_release (abfd, reloc_buff);
- if (buff != NULL)
- free (buff);
+ free (buff);
return FALSE;
}
@@ -3528,17 +3524,13 @@ ecoff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
result = ecoff_link_add_externals (abfd, info, external_ext, ssext);
- if (ssext != NULL)
- free (ssext);
- if (external_ext != NULL)
- free (external_ext);
+ free (ssext);
+ free (external_ext);
return result;
error_return:
- if (ssext != NULL)
- free (ssext);
- if (external_ext != NULL)
- free (external_ext);
+ free (ssext);
+ free (external_ext);
return FALSE;
}
@@ -3820,24 +3812,15 @@ ecoff_final_link_debug_accumulate (bfd *output_bfd,
return_something:
if (ecoff_data (input_bfd)->raw_syments == NULL)
{
- if (debug->line != NULL)
- free (debug->line);
- if (debug->external_dnr != NULL)
- free (debug->external_dnr);
- if (debug->external_pdr != NULL)
- free (debug->external_pdr);
- if (debug->external_sym != NULL)
- free (debug->external_sym);
- if (debug->external_opt != NULL)
- free (debug->external_opt);
- if (debug->external_aux != NULL)
- free (debug->external_aux);
- if (debug->ss != NULL)
- free (debug->ss);
- if (debug->external_fdr != NULL)
- free (debug->external_fdr);
- if (debug->external_rfd != NULL)
- free (debug->external_rfd);
+ free (debug->line);
+ free (debug->external_dnr);
+ free (debug->external_pdr);
+ free (debug->external_sym);
+ free (debug->external_opt);
+ free (debug->external_aux);
+ free (debug->ss);
+ free (debug->external_fdr);
+ free (debug->external_rfd);
/* Make sure we don't accidentally follow one of these pointers
into freed memory. */
@@ -3926,17 +3909,13 @@ ecoff_indirect_link_order (bfd *output_bfd,
output_section->reloc_count += input_section->reloc_count;
}
- if (contents != NULL)
- free (contents);
- if (external_relocs != NULL)
- free (external_relocs);
+ free (contents);
+ free (external_relocs);
return TRUE;
error_return:
- if (contents != NULL)
- free (contents);
- if (external_relocs != NULL)
- free (external_relocs);
+ free (contents);
+ free (external_relocs);
return FALSE;
}