]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/solib-darwin.c
* symfile.c (symfile_bfd_open): Don't copy name. Call
[thirdparty/binutils-gdb.git] / gdb / solib-darwin.c
index bc2cd795ebde1da1002016868b40646adc66d640..242f8cc1f6beb813fe6c4032dab9516bad7004bf 100644 (file)
@@ -510,17 +510,10 @@ darwin_bfd_open (char *pathname)
                                gdbarch_bfd_arch_info (target_gdbarch));
   if (!res)
     {
-      gdb_bfd_unref (abfd);
-      make_cleanup (xfree, found_pathname);
+      make_cleanup_bfd_close (abfd);
       error (_("`%s': not a shared-library: %s"),
-            found_pathname, bfd_errmsg (bfd_get_error ()));
+            bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ()));
     }
-
-  /* Make sure that the filename is malloc'ed.  The current filename
-     for fat-binaries BFDs is a name that was generated by BFD, usually
-     a static string containing the name of the architecture.  */
-  res->filename = xstrdup (pathname);
-
   return res;
 }