From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id AB759385840B; Fri, 22 Mar 2024 19:49:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB759385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711136940; bh=XDgPRV3H74e4AP/yDjvZDUFgoA7dbBwsuA+Bz/2v3t4=; h=From:To:Subject:Date:From; b=ht7wae+yIcIDqWEWi0Yd9jb+nNOM++hCfyDYTjcJ0hvDw7Zpda5Bq0O+RnlXBWbq5 un5yXLT+cUp5CCHhHT0fv/0Y808a591zNaYtc37SVpT5JbTY45P44kWVhme2dSWvfO 1SDEhKvU+DEruKGqs/ln0U7pbWAj1eczeU2co92c= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] windows-nat: Use gdb_realpath X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 30512efab1478ece80cf98d00eb70681afaf7412 X-Git-Newrev: e9315f148d56b3f4c7cfeef469633e85933d412c Message-Id: <20240322194900.AB759385840B@sourceware.org> Date: Fri, 22 Mar 2024 19:49:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De9315f148d56= b3f4c7cfeef469633e85933d412c commit e9315f148d56b3f4c7cfeef469633e85933d412c Author: Pedro Alves Date: Fri Mar 22 19:46:59 2024 +0000 windows-nat: Use gdb_realpath =20 Use gdb_realpath instead of realpath in windows-nat.c:windows_make_so, so that we don't have to manually call free. =20 Approved-By: John Baldwin Change-Id: Id3cda7e177ac984c9a5f7c23f354e72bd561edff Diff: --- gdb/windows-nat.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 =3D realpath (name, NULL); + gdb::unique_xmalloc_ptr rname =3D gdb_realpath (name); if (rname !=3D nullptr) - { - so->name =3D rname; - free (rname); - } + so->name =3D rname.get (); else { warning (_("dll path for \"%s\" inaccessible"), name);