summaryrefslogtreecommitdiff
path: root/gdb/m32r-rom.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m32r-rom.c')
-rw-r--r--gdb/m32r-rom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c
index ffda6f91b7f..5678f13dc3b 100644
--- a/gdb/m32r-rom.c
+++ b/gdb/m32r-rom.c
@@ -130,7 +130,8 @@ m32r_load (char *filename, int from_tty)
if (filename == NULL || filename[0] == 0)
filename = get_exec_file (1);
- abfd = gdb_bfd_ref (bfd_openr (filename, 0));
+ abfd = bfd_openr (filename, 0);
+ gdb_bfd_ref (abfd);
if (!abfd)
error (_("Unable to open file %s."), filename);
cleanup = make_cleanup_bfd_unref (abfd);
@@ -529,7 +530,8 @@ m32r_upload_command (char *args, int from_tty)
printf_filtered (" -- Ethernet load complete.\n");
gettimeofday (&end_time, NULL);
- abfd = gdb_bfd_ref (bfd_openr (args, 0));
+ abfd = bfd_openr (args, 0);
+ gdb_bfd_ref (abfd);
cleanup = make_cleanup_bfd_unref (abfd);
if (abfd != NULL)
{ /* Download is done -- print section statistics. */