summaryrefslogtreecommitdiff
path: root/gdb/windows-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/windows-tdep.c')
-rw-r--r--gdb/windows-tdep.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index e77996f7975..62a303d3170 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -372,7 +372,6 @@ windows_xfer_shared_library (const char* so_name, CORE_ADDR load_addr,
struct gdbarch *gdbarch, struct obstack *obstack)
{
char *p;
- struct bfd * dll;
CORE_ADDR text_offset;
obstack_grow_str (obstack, "<library name=\"");
@@ -380,12 +379,11 @@ windows_xfer_shared_library (const char* so_name, CORE_ADDR load_addr,
obstack_grow_str (obstack, p);
xfree (p);
obstack_grow_str (obstack, "\"><segment address=\"");
- dll = gdb_bfd_open (so_name, gnutarget, -1);
+ gdb_bfd_ref_ptr dll (gdb_bfd_open (so_name, gnutarget, -1));
/* The following calls are OK even if dll is NULL.
The default value 0x1000 is returned by pe_text_section_offset
in that case. */
- text_offset = pe_text_section_offset (dll);
- gdb_bfd_unref (dll);
+ text_offset = pe_text_section_offset (dll.get ());
obstack_grow_str (obstack, paddress (gdbarch, load_addr + text_offset));
obstack_grow_str (obstack, "\"/></library>");
}