daily update
[binutils-gdb.git] / gdb / solib-darwin.c
index 4de8cb4d8a6b9c766e7e6b4c90b23326b0631e37..e8d46672189c02e42b2caee6f10e5d57d289f87d 100644 (file)
@@ -1,6 +1,6 @@
 /* Handle Darwin shared libraries for GDB, the GNU Debugger.
 
-   Copyright (C) 2009-2013 Free Software Foundation, Inc.
+   Copyright (C) 2009-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -103,7 +103,7 @@ get_darwin_info (void)
   if (info != NULL)
     return info;
 
-  info = XZALLOC (struct darwin_info);
+  info = XCNEW (struct darwin_info);
   set_program_space_data (current_program_space,
                          solib_darwin_pspace_data, info);
   return info;
@@ -304,7 +304,7 @@ darwin_current_sos (void)
        break;
 
       /* Create and fill the new so_list element.  */
-      dnew = XZALLOC (struct darwin_so_list);
+      dnew = XCNEW (struct darwin_so_list);
       new = &dnew->sl;
       old_chain = make_cleanup (xfree, dnew);
 
@@ -621,12 +621,8 @@ darwin_bfd_open (char *pathname)
   /* The current filename for fat-binary BFDs is a name generated
      by BFD, usually a string containing the name of the architecture.
      Reset its value to the actual filename.  */
-    {
-      char *data = bfd_alloc (res, strlen (pathname) + 1);
-
-      strcpy (data, pathname);
-      res->filename = data;
-    }
+  xfree (bfd_get_filename (res));
+  res->filename = xstrdup (pathname);
 
   gdb_bfd_unref (abfd);
   return res;