public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] windows-nat: Use gdb_realpath
@ 2024-03-22 19:49 Pedro Alves
0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2024-03-22 19:49 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e9315f148d56b3f4c7cfeef469633e85933d412c
commit e9315f148d56b3f4c7cfeef469633e85933d412c
Author: Pedro Alves <pedro@palves.net>
Date: Fri Mar 22 19:46:59 2024 +0000
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 <jhb@FreeBSD.org>
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 = 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-22 19:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 19:49 [binutils-gdb] windows-nat: Use gdb_realpath Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).