diff options
Diffstat (limited to 'bfd/elf32-cr16.c')
-rw-r--r-- | bfd/elf32-cr16.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index c74cb22..62906c8 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -824,10 +824,9 @@ cr16_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, } } - result = TRUE; - fail: - if (isymbuf != NULL) - free (isymbuf); + result = TRUE; + fail: + free (isymbuf); return result; } @@ -1572,10 +1571,8 @@ elf32_cr16_get_relocated_section_contents (bfd *output_bfd, isymbuf, sections)) goto error_return; - if (sections != NULL) - free (sections); - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + free (sections); + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); @@ -1584,13 +1581,10 @@ elf32_cr16_get_relocated_section_contents (bfd *output_bfd, return data; error_return: - if (sections != NULL) - free (sections); - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + free (sections); + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (input_section)->relocs != internal_relocs) + if (elf_section_data (input_section)->relocs != internal_relocs) free (internal_relocs); return NULL; } @@ -2174,21 +2168,17 @@ elf32_cr16_relax_section (bfd *abfd, asection *sec, } - if (internal_relocs != NULL - && elf_section_data (sec)->relocs != internal_relocs) + if (elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); return TRUE; error_return: - if (isymbuf != NULL - && symtab_hdr->contents != (unsigned char *) isymbuf) + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (contents != NULL - && elf_section_data (sec)->this_hdr.contents != contents) + if (elf_section_data (sec)->this_hdr.contents != contents) free (contents); - if (internal_relocs != NULL - && elf_section_data (sec)->relocs != internal_relocs) + if (elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); return FALSE; @@ -2847,18 +2837,16 @@ bfd_cr16_elf32_create_embedded_relocs (bfd *abfd, strncpy ((char *) p + 4, targetsec->output_section->name, 4); } - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (datasec)->relocs != internal_relocs) + if (elf_section_data (datasec)->relocs != internal_relocs) free (internal_relocs); return TRUE; error_return: - if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) + if (symtab_hdr->contents != (unsigned char *) isymbuf) free (isymbuf); - if (internal_relocs != NULL - && elf_section_data (datasec)->relocs != internal_relocs) + if (elf_section_data (datasec)->relocs != internal_relocs) free (internal_relocs); return FALSE; } |