Return unique_xmalloc_ptr from some solib.c functions
[deliverable/binutils-gdb.git] / gdb / solib-aix.c
index 463f0608450a1479d849cd3ed8a3585cf1da2e05..aa0e0d2dfbd1ad15e46b2927541ad71c6729e9da 100644 (file)
@@ -614,7 +614,6 @@ solib_aix_bfd_open (char *pathname)
   char *sep;
   int filename_len;
   int found_file;
-  char *found_pathname;
 
   if (pathname[path_len - 1] != ')')
     return solib_bfd_open (pathname);
@@ -638,10 +637,12 @@ solib_aix_bfd_open (char *pathname)
   /* Calling solib_find makes certain that sysroot path is set properly
      if program has a dependency on .a archive and sysroot is set via
      set sysroot command.  */
-  found_pathname = solib_find (filename.c_str (), &found_file);
+  gdb::unique_xmalloc_ptr<char> found_pathname
+    = solib_find (filename.c_str (), &found_file);
   if (found_pathname == NULL)
       perror_with_name (pathname);
-  gdb_bfd_ref_ptr archive_bfd (solib_bfd_fopen (found_pathname, found_file));
+  gdb_bfd_ref_ptr archive_bfd (solib_bfd_fopen (found_pathname.get (),
+                                               found_file));
   if (archive_bfd == NULL)
     {
       warning (_("Could not open `%s' as an executable file: %s"),
This page took 0.024945 seconds and 4 git commands to generate.