* remote-mips.c (mips_load_srec): Use make_cleanup_bfd_close.

(pmon_load_fast): Likewise.
	* m32r-rom.c (m32r_load): Use make_cleanup_bfd_close.
	(m32r_upload_command): Likewise.
	* dsrec.c (load_srec): Use make_cleanup_bfd_close.
	* solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init):
	Use make_cleanup_bfd_close.
This commit is contained in:
Tom Tromey
2012-07-18 19:38:39 +00:00
parent a4453b7e0b
commit d6ad71ba41
5 changed files with 41 additions and 6 deletions

View File

@@ -57,6 +57,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
int reclen;
time_t start_time, end_time;
unsigned long data_count = 0;
struct cleanup *cleanup;
srec = (char *) alloca (maxrecsize + 1);
@@ -67,9 +68,11 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
return;
}
cleanup = make_cleanup_bfd_close (abfd);
if (bfd_check_format (abfd, bfd_object) == 0)
{
printf_filtered (_("File is not an object file\n"));
do_cleanups (cleanup);
return;
}
@@ -171,6 +174,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
serial_flush_input (desc);
report_transfer_performance (data_count, start_time, end_time);
do_cleanups (cleanup);
}
/*