diff options
author | Alan Modra <amodra@gmail.com> | 2002-07-30 05:49:24 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-07-30 05:49:24 +0000 |
commit | 487e54f29acc5750992ab2e07574b872a32973ee (patch) | |
tree | dbbc9d8064271f0e56374706f78a69e1e05debd4 /bfd/ieee.c | |
parent | 9d46020e53ef3b47c3b9fa90d4f93410f233d3d7 (diff) | |
download | gdb-487e54f29acc5750992ab2e07574b872a32973ee.zip gdb-487e54f29acc5750992ab2e07574b872a32973ee.tar.gz gdb-487e54f29acc5750992ab2e07574b872a32973ee.tar.bz2 |
* aoutx.h (some_aout_object_p): Clean up tdata properly on error.
* archive.c (bfd_generic_archive_p): Likewise.
* coff-rs6000.c (_bfd_xcoff_archive_p): Likewise.
(_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol.
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
(xcoff64_archive_p): Likewise.
(xcoff64_openr_next_archived_file): Likewise.
(xcoff64_archive_p): Clean up tdata properly on error.
* coffgen.c (coff_real_object_p): Likewise.
(coff_object_p): Release filehdr and opthdr.
* ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error.
* ieee.c (ieee_archive_p): Likewise.
* ihex.c (ihex_object_p): Likewise.
(ihex_mkobject): Always allocate tdata.
* peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error.
* srec.c (srec_mkobject): Always allocate tdata.
(srec_object_p): Clean up tdata properly on error.
(symbolsrec_object_p): Likewise.
* versados.c (versados_object_p): Likewise.
* vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc,
and bfd_realloc instead of realloc.
(add_new_contents): Use bfd_alloc instead of bfd_malloc for sections.
* vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in
place of bfd_malloc, simplifying error freeing. Free hash table too.
(vms_object_p): Clean up tdata on error.
(vms_mkobject): Don't complain on stderr if vms_initialize fails.
(vms_close_and_cleanup): Adjust for bfd_alloc use.
Diffstat (limited to 'bfd/ieee.c')
-rw-r--r-- | bfd/ieee.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1414,7 +1414,7 @@ ieee_archive_p (abfd) abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, amt); if (!abfd->tdata.ieee_ar_data) - goto error_return; + goto error_ret_restore; ieee = IEEE_AR_DATA (abfd); /* Ignore the return value here. It doesn't matter if we don't read @@ -1530,13 +1530,13 @@ ieee_archive_p (abfd) return abfd->xvec; got_wrong_format_error: - bfd_release (abfd, ieee); - abfd->tdata.ieee_ar_data = save; bfd_set_error (bfd_error_wrong_format); - error_return: if (elts != NULL) free (elts); + bfd_release (abfd, ieee); + error_ret_restore: + abfd->tdata.ieee_ar_data = save; return NULL; } @@ -1732,7 +1732,7 @@ ieee_object_p (abfd) got_wrong_format: bfd_set_error (bfd_error_wrong_format); fail: - (void) bfd_release (abfd, ieee); + bfd_release (abfd, ieee); abfd->tdata.ieee_data = save; return (const bfd_target *) NULL; } |