]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
windows-nat: Use gdb_realpath
authorPedro Alves <pedro@palves.net>
Fri, 22 Mar 2024 19:46:59 +0000 (19:46 +0000)
committerPedro Alves <pedro@palves.net>
Fri, 22 Mar 2024 19:46:59 +0000 (19:46 +0000)
Use gdb_realpath instead of realpath in windows-nat.c:windows_make_so,
so that we don't have to manually call free.

Approved-By: John Baldwin <jhb@FreeBSD.org>
Change-Id: Id3cda7e177ac984c9a5f7c23f354e72bd561edff

gdb/windows-nat.c

index 278bfb0e1f1fb6b5619e9ff8edea6d0c07557dec..ee38b985efa748cc5c67513333c0294ae3e983c4 100644 (file)
@@ -891,12 +891,9 @@ windows_make_so (const char *name, LPVOID load_addr)
     }
   else
     {
-      char *rname = realpath (name, NULL);
+      gdb::unique_xmalloc_ptr<char> rname = gdb_realpath (name);
       if (rname != nullptr)
-       {
-         so->name = rname;
-         free (rname);
-       }
+       so->name = rname.get ();
       else
        {
          warning (_("dll path for \"%s\" inaccessible"), name);