From d6ad71ba41afb220549d1c7fe61edd6bddd128ad Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Jul 2012 19:38:39 +0000 Subject: * 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. --- gdb/dsrec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/dsrec.c') diff --git a/gdb/dsrec.c b/gdb/dsrec.c index 54f2971..8eefe1e 100644 --- a/gdb/dsrec.c +++ b/gdb/dsrec.c @@ -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); } /* -- cgit v1.1