Return unique_xmalloc_ptr from some solib.c functions
[deliverable/binutils-gdb.git] / gdb / solib-darwin.c
index 121a7135c05130760d2067411a0a1df4001dc6d3..ed8f9da2573ca62f3979f7ebe3fc1b2714df39bb 100644 (file)
@@ -619,16 +619,16 @@ darwin_lookup_lib_symbol (struct objfile *objfile,
 static gdb_bfd_ref_ptr
 darwin_bfd_open (char *pathname)
 {
-  char *found_pathname;
   int found_file;
 
   /* Search for shared library file.  */
-  found_pathname = solib_find (pathname, &found_file);
+  gdb::unique_xmalloc_ptr<char> found_pathname
+    = solib_find (pathname, &found_file);
   if (found_pathname == NULL)
     perror_with_name (pathname);
 
   /* Open bfd for shared library.  */
-  gdb_bfd_ref_ptr abfd (solib_bfd_fopen (found_pathname, found_file));
+  gdb_bfd_ref_ptr abfd (solib_bfd_fopen (found_pathname.get (), found_file));
 
   gdb_bfd_ref_ptr res
     (gdb_bfd_mach_o_fat_extract (abfd.get (), bfd_object,
This page took 0.026983 seconds and 4 git commands to generate.