to allow commands listing all shared libraries to display that
synthetic name. Otherwise, we would only be displaying the name
of the archive member object. */
- {
- char *data = bfd_alloc (object_bfd, path_len + 1);
-
- strcpy (data, pathname);
- object_bfd->filename = data;
- }
+ xfree (bfd_get_filename (object_bfd));
+ object_bfd->filename = xstrdup (pathname);
gdb_bfd_unref (archive_bfd);
do_cleanups (cleanup);