diff options
Diffstat (limited to 'bfd/pdp11.c')
-rw-r--r-- | bfd/pdp11.c | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/bfd/pdp11.c b/bfd/pdp11.c index 4555b36..adcf34d 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -2347,8 +2347,7 @@ NAME (aout, find_nearest_line) (bfd *abfd, else funclen = strlen (bfd_asymbol_name (func)); - if (adata (abfd).line_buf != NULL) - free (adata (abfd).line_buf); + free (adata (abfd).line_buf); if (filelen + funclen == 0) adata (abfd).line_buf = buf = NULL; else @@ -2415,7 +2414,7 @@ NAME (aout, bfd_free_cached_info) (bfd *abfd) if (bfd_get_format (abfd) != bfd_object) return TRUE; -#define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; } +#define BFCI_FREE(x) do { free (x); x = NULL; } while (0) BFCI_FREE (obj_aout_symbols (abfd)); #ifdef USE_MMAP @@ -3914,26 +3913,14 @@ NAME (aout, final_link) (bfd *abfd, } } - if (aout_info.contents != NULL) - { - free (aout_info.contents); - aout_info.contents = NULL; - } - if (aout_info.relocs != NULL) - { - free (aout_info.relocs); - aout_info.relocs = NULL; - } - if (aout_info.symbol_map != NULL) - { - free (aout_info.symbol_map); - aout_info.symbol_map = NULL; - } - if (aout_info.output_syms != NULL) - { - free (aout_info.output_syms); - aout_info.output_syms = NULL; - } + free (aout_info.contents); + aout_info.contents = NULL; + free (aout_info.relocs); + aout_info.relocs = NULL; + free (aout_info.symbol_map); + aout_info.symbol_map = NULL; + free (aout_info.output_syms); + aout_info.output_syms = NULL; if (includes_hash_initialized) { bfd_hash_table_free (&aout_info.includes.root); @@ -3993,14 +3980,10 @@ NAME (aout, final_link) (bfd *abfd, return TRUE; error_return: - if (aout_info.contents != NULL) - free (aout_info.contents); - if (aout_info.relocs != NULL) - free (aout_info.relocs); - if (aout_info.symbol_map != NULL) - free (aout_info.symbol_map); - if (aout_info.output_syms != NULL) - free (aout_info.output_syms); + free (aout_info.contents); + free (aout_info.relocs); + free (aout_info.symbol_map); + free (aout_info.output_syms); if (includes_hash_initialized) bfd_hash_table_free (&aout_info.includes.root); return FALSE; |