aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.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/dwarf2.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/dwarf2.c')
-rw-r--r--bfd/dwarf2.c43
1 files changed, 13 insertions, 30 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 48b1bdc..9ed4a4a 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -2420,8 +2420,7 @@ decode_line_info (struct comp_unit *unit)
(_("DWARF error: mangled line number section"));
bfd_set_error (bfd_error_bad_value);
line_fail:
- if (filename != NULL)
- free (filename);
+ free (filename);
goto fail;
}
break;
@@ -2466,8 +2465,7 @@ decode_line_info (struct comp_unit *unit)
filenum = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read,
FALSE, line_end);
line_ptr += bytes_read;
- if (filename)
- free (filename);
+ free (filename);
filename = concat_filename (table, filenum);
break;
}
@@ -2513,8 +2511,7 @@ decode_line_info (struct comp_unit *unit)
}
}
- if (filename)
- free (filename);
+ free (filename);
}
if (unit->line_offset == 0)
@@ -2529,10 +2526,8 @@ decode_line_info (struct comp_unit *unit)
table->sequences = table->sequences->prev_sequence;
free (seq);
}
- if (table->files != NULL)
- free (table->files);
- if (table->dirs != NULL)
- free (table->dirs);
+ free (table->files);
+ free (table->dirs);
return NULL;
}
@@ -5146,34 +5141,22 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
free (each->line_table->dirs);
}
- if (each->lookup_funcinfo_table)
- {
- free (each->lookup_funcinfo_table);
- each->lookup_funcinfo_table = NULL;
- }
+ free (each->lookup_funcinfo_table);
+ each->lookup_funcinfo_table = NULL;
while (function_table)
{
- if (function_table->file)
- {
- free (function_table->file);
- function_table->file = NULL;
- }
- if (function_table->caller_file)
- {
- free (function_table->caller_file);
- function_table->caller_file = NULL;
- }
+ free (function_table->file);
+ function_table->file = NULL;
+ free (function_table->caller_file);
+ function_table->caller_file = NULL;
function_table = function_table->prev_func;
}
while (variable_table)
{
- if (variable_table->file)
- {
- free (variable_table->file);
- variable_table->file = NULL;
- }
+ free (variable_table->file);
+ variable_table->file = NULL;
variable_table = variable_table->prev_var;
}
}