aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdb_bfd.c')
-rw-r--r--gdb/gdb_bfd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index fff71d0..330d918 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -649,7 +649,8 @@ static int
gdb_bfd_close_or_warn (struct bfd *abfd)
{
int ret;
- const char *name = bfd_get_filename (abfd);
+ gdb::unique_xmalloc_ptr<char> name
+ = make_unique_xstrdup (bfd_get_filename (abfd));
for (asection *sect : gdb_bfd_sections (abfd))
free_one_bfd_section (sect);
@@ -657,7 +658,7 @@ gdb_bfd_close_or_warn (struct bfd *abfd)
ret = bfd_close (abfd);
if (!ret)
- gdb_bfd_close_warning (name,
+ gdb_bfd_close_warning (name.get (),
bfd_errmsg (bfd_get_error ()));
return ret;