X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Faoutx.h;h=08083c1555f17ff56a4c20f00d9dde43c7093c4b;hb=af0b2a3e85df9f49a3528e5b7578fcf9412f1acc;hp=4cf5713c355fc3c6b9d6dfee627d759de8a043fb;hpb=765cf5f623dbc2de8c8791bce9a29fcc3492436c;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/aoutx.h b/bfd/aoutx.h index 4cf5713c35..08083c1555 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -2816,8 +2816,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; @@ -2899,7 +2898,7 @@ NAME (aout, bfd_free_cached_info) (bfd *abfd) || abfd->tdata.aout_data == NULL) 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 obj_aout_external_syms (abfd) = 0; @@ -5617,26 +5616,15 @@ 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); @@ -5679,14 +5667,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;