From: Pedro Alves Date: Fri, 22 Mar 2024 19:46:59 +0000 (+0000) Subject: windows-nat: Use gdb_realpath X-Git-Tag: gdb-15-branchpoint~645 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9315f148d56b3f4c7cfeef469633e85933d412c;p=thirdparty%2Fbinutils-gdb.git windows-nat: Use gdb_realpath 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 Change-Id: Id3cda7e177ac984c9a5f7c23f354e72bd561edff --- diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 278bfb0e1f1..ee38b985efa 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -891,12 +891,9 @@ windows_make_so (const char *name, LPVOID load_addr) } else { - char *rname = realpath (name, NULL); + gdb::unique_xmalloc_ptr rname = gdb_realpath (name); if (rname != nullptr) - { - so->name = rname; - free (rname); - } + so->name = rname.get (); else { warning (_("dll path for \"%s\" inaccessible"), name);