mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
* 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:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user