aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-spu.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-18 10:34:46 +0930
committerAlan Modra <amodra@gmail.com>2019-09-18 21:32:51 +0930
commit90d92a632aaf75ce698335efeb383ddf785c12d8 (patch)
tree66d29393e4100245fd03bfd25d97e98861772cf2 /gdb/solib-spu.c
parent1bdd8facfbf6f94fa9603f528c7e8bdf91d90bfd (diff)
downloadfsf-binutils-gdb-90d92a632aaf75ce698335efeb383ddf785c12d8.zip
fsf-binutils-gdb-90d92a632aaf75ce698335efeb383ddf785c12d8.tar.gz
fsf-binutils-gdb-90d92a632aaf75ce698335efeb383ddf785c12d8.tar.bz2
Use bfd_set_filename more
Fixes a few leaks in bfd and ld. bfd/ * mach-o.c (bfd_mach_o_fat_member_init): Likewise. Replace xstrdup and xmalloc with bfd_strdup and bfd_malloc. Return an error status. Adjust calls. * vms-lib.c (_bfd_vms_lib_get_module): Test mhd->id earlier. Close bfd on failure. Replace xstrdup/bfd_alloc use with bfd_malloc. Use bfd_set_filename. gdb/ * solib-spu.c (spu_bfd_open): Use bfd_set_filename. * spu-linux-nat.c (spu_bfd_open): Likewise. ld/ * emultempl/pe.em (after_open): Use bfd_set_filename. * emultempl/pep.em (after_open): Use bfd_set_filename.
Diffstat (limited to 'gdb/solib-spu.c')
-rw-r--r--gdb/solib-spu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 5b97b9b..c5e0aca 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -377,8 +377,7 @@ spu_bfd_open (const char *pathname)
strcat (buf, original_name);
- xfree ((char *)abfd->filename);
- abfd->filename = xstrdup (buf);
+ bfd_set_filename (abfd.get (), xstrdup (buf));
}
}