diff options
Diffstat (limited to 'gdb/cli/cli-dump.c')
-rw-r--r-- | gdb/cli/cli-dump.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 1244767..5998b3f 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -112,7 +112,8 @@ bfd_openr_with_cleanup (const char *filename, const char *target) { bfd *ibfd; - ibfd = gdb_bfd_ref (bfd_openr (filename, target)); + ibfd = bfd_openr (filename, target); + gdb_bfd_ref (ibfd); if (ibfd == NULL) error (_("Failed to open %s: %s."), filename, bfd_errmsg (bfd_get_error ())); @@ -132,7 +133,8 @@ bfd_openw_with_cleanup (const char *filename, const char *target, if (*mode == 'w') /* Write: create new file */ { - obfd = gdb_bfd_ref (bfd_openw (filename, target)); + obfd = bfd_openw (filename, target); + gdb_bfd_ref (obfd); if (obfd == NULL) error (_("Failed to open %s: %s."), filename, bfd_errmsg (bfd_get_error ())); |