From 1be5090bcaf4bcab333cf03f4157b16d33881222 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 2 Jan 2014 12:14:37 +0000 Subject: PR binutils/11983 * archive.c (_bfd_get_elt_at_filepos): Store a copy of the filename in the bfd's filename field. * elfcode.h (bfd_from_remote_memory): Likewise. * ieee.c (ieee_object_p): Likewise. * mach-o.c (bfd_mach_o_fat_member_init): Likewise. * oasys.c (oasys_openr_next_archived_file): Likewise. * vms-lib.c (_bfd_vms_lib_get_module): Likewise. * opncls.c (bfd_fopen): Likewise. (bfd_openstreamr): Likewise. (bfd_openr_iovec): Likewise. (bfd_openw): Likewise. (bfd_create): Likewise. (_bfd_delete_bfd): Free filename. --- bfd/mach-o.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bfd/mach-o.c') diff --git a/bfd/mach-o.c b/bfd/mach-o.c index ffe7332..6640a6a 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -4353,13 +4353,13 @@ bfd_mach_o_fat_member_init (bfd *abfd, if (ap) { /* Use the architecture name if known. */ - abfd->filename = ap->printable_name; + abfd->filename = xstrdup (ap->printable_name); } else { /* Forge a uniq id. */ const size_t namelen = 2 + 8 + 1 + 2 + 8 + 1; - char *name = bfd_alloc (abfd, namelen); + char *name = xmalloc (namelen); snprintf (name, namelen, "0x%lx-0x%lx", entry->cputype, entry->cpusubtype); abfd->filename = name; -- cgit v1.1