aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-03-31 09:45:23 -0600
committerTom Tromey <tromey@adacore.com>2022-04-04 13:58:37 -0600
commit04ae91ea5223735820f44d580055362b06a6df73 (patch)
treed7246dea8acb938c27cd6ded42ad1d0793533186 /gdb
parent85b25bd9759a606ce32eab736381c3ca600bd367 (diff)
downloadgdb-04ae91ea5223735820f44d580055362b06a6df73.zip
gdb-04ae91ea5223735820f44d580055362b06a6df73.tar.gz
gdb-04ae91ea5223735820f44d580055362b06a6df73.tar.bz2
Use auto_obstack in windows-nat.c
One spot in windows-nat.c can use auto_obstack, removing some manual memory management.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/windows-nat.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 1e34651..74f7361 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2877,14 +2877,13 @@ windows_xfer_shared_libraries (struct target_ops *ops,
ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len)
{
- struct obstack obstack;
+ auto_obstack obstack;
const char *buf;
LONGEST len_avail;
if (writebuf)
return TARGET_XFER_E_IO;
- obstack_init (&obstack);
obstack_grow_str (&obstack, "<library-list>\n");
for (windows_solib &so : solibs)
windows_xfer_shared_library (so.name.c_str (),
@@ -2904,7 +2903,6 @@ windows_xfer_shared_libraries (struct target_ops *ops,
memcpy (readbuf, buf + offset, len);
}
- obstack_free (&obstack, NULL);
*xfered_len = (ULONGEST) len;
return len != 0 ? TARGET_XFER_OK : TARGET_XFER_EOF;
}